+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}</ProjectGuid>
- <OutputType>Library</OutputType>
- <RootNamespace>Crow.Test</RootNamespace>
- <AssemblyName>Crow.Test</AssemblyName>
- <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
- <ReleaseVersion>0.7</ReleaseVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <Optimize>true</Optimize>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="nunit.framework">
- <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Test.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- <None Include="ExpectedOutputs\0.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="ExpectedOutputs\1.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="ExpectedOutputs\3.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="ExpectedOutputs\4.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="ExpectedOutputs\5.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\0.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\1.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\2.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\3.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\4.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\5.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\testButton.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Crow.csproj">
- <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
- <Name>Crow</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Folder Include="ExpectedOutputs\" />
- <Folder Include="Interfaces\" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<GraphicObject Width="100" Height="100" Background="Green"/>
+++ /dev/null
-<?xml version="1.0"?>
-<Container Width="300" Height="300" Margin="20" Background="Yellow">
- <Container Width="0" Height="0" Margin="20" Background="Green">
- <GraphicObject VerticalAlignment="Bottom" Width="50" Height="50"
- Background="Red"/>
- </Container>
-</Container>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Fit="true">
- <HorizontalStack Fit="true">
- <Label Text="label1"/>
- <TextRun Text="textrun1"/>
- </HorizontalStack>
-</VerticalStack>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<HorizontalStack Margin="5" Background="DimGray">
- <VerticalStack Width="200" Margin="5" Background="Gray">
- <VerticalStack Fit="true" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </VerticalStack>
- <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue" Width="Stretched"/>
- <TextRun Background="SkyBlue" Height="Stretched"/>
- </VerticalStack>
- <HorizontalStack Fit="true" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue" Width="Stretched"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- </VerticalStack>
- <VerticalStack Width="Stretched" Height="Stretched" Margin="5" Background="Gray">
- <VerticalStack Fit="true" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </VerticalStack>
- <VerticalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue" Width="Stretched"/>
- <TextRun TextAlignment="Center" Background="SkyBlue" Width="Stretched" Height="Stretched"/>
- </VerticalStack>
- <HorizontalStack Fit="true" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue" Width="Stretched"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- </VerticalStack>
- <VerticalStack Width="Fit" Margin="5" Background="Gray">
- <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue" HorizontalAlignment="Left"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </VerticalStack>
- <VerticalStack Width="0" Height="Fit" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue" Width="Stretched"/>
- <TextRun Background="SkyBlue" Height="Stretched"/>
- </VerticalStack>
- <HorizontalStack Fit="true" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5">
- <TextRun Background="SkyBlue"/>
- <TextRun Background="SkyBlue" Width="Stretched"/>
- <TextRun Background="SkyBlue"/>
- </HorizontalStack>
- </VerticalStack>
-</HorizontalStack>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Fit="true" Spacing="0">
- <Label Text="SCALED PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed" Width="0"/>
- <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
- <Image Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg"/>
- <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" />
- <Image Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
- <Image Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
- <Image Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
- <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
- <Image Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
- <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
- <Image Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" />
- <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" />
- </HorizontalStack>
- <Label Text="SCALED NOT PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/>
- <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
- <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" />
- <Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" />
- </HorizontalStack>
- <Label Text="UNSCALED" Background="hgradient|0:DimGray|1:DarkRed"/>
- <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
- <Image Scaled="false" Background="Blue" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Background="Blue" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Background="Blue" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Background="Blue" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" />
- <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.image.crow0.svg" />
- </HorizontalStack>
- <Label Text="SCALED PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/>
- <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent">
- <Image Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/>
- </HorizontalStack>
- <Label Text="SCALED NOT PROPORTIONNAL" Background="hgradient|0:DimGray|1:DarkRed"/>
- <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent">
- <Image KeepProportions="false" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/>
- <Image KeepProportions="false" Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/>
- </HorizontalStack>
- <Label Text="UNSCALED" Background="hgradient|0:DimGray|1:DarkRed"/>
- <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" >
- <Image Scaled="false" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="50" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="25" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/>
- <Image Scaled="false" Margin="10" Background="Blue" Width="25" Height="Fit" Path="#Crow.Images.Icons.tetra.png"/>
- </HorizontalStack>
-</VerticalStack>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<HorizontalStack Fit="true" Margin="5">
- <VerticalStack Fit="true" Margin="2" Spacing="2">
- <TextRun Text="text run test"/>
- <Label Text="label test"/>
- <TextBox Text="text box test"/>
- <Button Caption="test button"/>
- <CheckBox Caption="test checkbox"/>
- <RadioButton Caption="test radiobutton"/>
- <ComboBox/>
- <Popper Caption="test popper">
- <Label Text="label test"/>
- </Popper>
- <Expandable Caption="test expandable">
- <Label Text="label test"/>
- </Expandable>
- <Border >
- <Label Text="border test" Margin="3"/>
- </Border>
- <GroupBox Caption="Group box" >
- <Label Text="border test" Margin="3"/>
- </GroupBox>
- <Container Fit="true" Background="DimGray" Margin="3">
- <GraphicObject Width="20" Height="20" Background="LightGray"/>
- </Container>
- <ProgressBar Height="10" Width="150" Background="DimGray" Value="50" />
- <Slider Value="5" Width="150" Height="10"/>
- <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="150"/>
- <Spinner Value="100"/>
- </VerticalStack>
- <VerticalStack Width="150" Height="Fit" Margin="2" Spacing="2">
- <TextRun Text="text run test" Width="0"/>
- <Label Text="label test" Width="0"/>
- <TextBox Text="text box test" Width="0"/>
- <Button Caption="test button" Width="0"/>
- <CheckBox Caption="test checkbox" Width="0"/>
- <RadioButton Caption="test radiobutton" Width="0"/>
- <ComboBox Width="0"/>
- <Popper Caption="test popper" Width="0">
- <Label Text="label test"/>
- </Popper>
- <Expandable Caption="test expandable" Width="0">
- <Label Text="label test"/>
- </Expandable>
- <Border Width="0">
- <Label Text="border test" Margin="3"/>
- </Border>
- <GroupBox Caption="Group box" Width="0">
- <Label Text="border test" Margin="3"/>
- </GroupBox>
- <Container Height="Fit" Width="0" Background="DimGray" Margin="3">
- <GraphicObject Width="20" Height="20" Background="LightGray"/>
- </Container>
- <ProgressBar Height="10" Width="0" Background="DimGray" Value="50" />
- <Slider Value="5" Width="0" Height="10"/>
- <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="0"/>
- <Spinner Value="100" Width="0"/>
- </VerticalStack>
-</HorizontalStack>
-<!--<HorizontalStack Fit="true" Background="RoyalBlue" Margin="5">
- <GraphicObject Background="Red" Width="30" Height="20"/>
- <Spinner Maximum="10000000000" SmallIncrement="10" Value="0"/>
- <GraphicObject Background="Green" Width="30" Height="20"/>
-</HorizontalStack>-->
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Fit="true">
- <HorizontalStack Fit="True">
- <Button Caption="but" MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack> <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
- <HorizontalStack Fit="True">
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- <Button MouseClick="onButClick"/>
- </HorizontalStack>
-</VerticalStack>
\ No newline at end of file
+++ /dev/null
-//
-// Test.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
-//
-// Copyright (c) 2016 jp
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-using NUnit.Framework;
-using System;
-using Crow;
-using System.IO;
-[assembly: Description ("Assembly description here")]
-namespace UnitTest
-{
- [TestFixture, Description ("Fixture description here")]
- public class Test
- {
- Interface iface;
- Rectangle bounds = new Rectangle (0, 0, 600, 600);
-
-
- [SetUp]
- public void Init ()
- {
- iface = new Interface ();
- iface.Init ();
- iface.ProcessResize (bounds);
- }
-
- [Test , Description("My really cool test")]
- public void GraphicObject ()
- {
- string [] tests = new string [] { "0", "1", "3", "4", "5" };
-
- foreach (string s in tests) {
- string fileName = Path.Combine ("Interfaces", s + ".crow");
- iface.AddWidget (fileName);
-
- iface.Update ();
- iface.Update ();
-
- using (Cairo.Surface surf = new Cairo.ImageSurface (iface.bmp,
- Cairo.Format.Argb32, iface.ClientRectangle.Width, iface.ClientRectangle.Height, iface.ClientRectangle.Width * 4)) {
- surf.WriteToPng (@"tmp.png");
- surf.WriteToPng (fileName + ".png");
- }
-
-
- byte [] model = File.ReadAllBytes ("ExpectedOutputs/" + s + ".png");
- byte [] result = File.ReadAllBytes (@"tmp.png");
-
- //CollectionAssert.AreEqual (model, result);
-
- iface.ClearInterface ();
- }
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="NUnit" version="2.6.4" targetFramework="net461" />
-</packages>
\ No newline at end of file
<OutputPath>$(SolutionDir)build\$(Configuration)</OutputPath>
<IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath>
<AssemblyOriginatorKeyFile>crow.key</AssemblyOriginatorKeyFile>
+ <ReleaseVersion>0.5</ReleaseVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
- <ReleaseVersion>0.5</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<Optimize>false</Optimize>
<OutputPath>$(SolutionDir)build\Debug</OutputPath>
- <DefineConstants>DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ <DefineConstants>XLIB_BACKEND0;DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ <EnvironmentVariables>
+ <EnvironmentVariables>
+ <Variable name="MONO_CAIRO_DEBUG_DISPOSE" value="1" />
+ </EnvironmentVariables>
+ </EnvironmentVariables>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<Compile Include="src\ParsingException.cs" />
<Compile Include="src\IMLAttributes.cs" />
<Compile Include="src\GraphicObjects\DockStack.cs" />
+ <Compile Include="src\XLib\Display.cs" />
+ <Compile Include="src\XLib\NativeMethods.cs" />
+ <Compile Include="src\XLib\Window.cs" />
+ <Compile Include="src\XLib\X11Structs.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Folder Include="src\rsvg\" />
<Folder Include="src\IML\" />
<Folder Include="Icons\" />
+ <Folder Include="src\XLib\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Images\Icons\updown.svg" />
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{74289092-9F70-4941-AFCB-DFD7BE2140B6}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Test", "Crow.Test\Crow.Test.csproj", "{42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}"
EndProject
Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
Height = "Fit";
}
Border {
- Foreground = "Gray";
+ Foreground = "Grey";
}
CheckBox { Caption = "CheckBox"; }
RadioButton { Caption = "RadioButton"; }
ControlBorder {
BorderWidth = "1";
- Foreground = "DimGray";
+ Foreground = "DimGrey";
Background = "Transparent";
}
ControlCaption {
- Foreground = "Gray";
+ Foreground = "Grey";
MouseEnter = "{Foreground=White}";
- MouseLeave = "{Foreground=Gray}";
+ MouseLeave = "{Foreground=Grey}";
}
Icon {
Margin = "1";
}
Menu {
Margin = "1";
- Background = "vgradient|0:DimGray|1:Black";
+ Background = "vgradient|0:DimGrey|1:Black";
Height = "Fit";
Width = "Stretched";
VerticalAlignment = "Top";
Width = "Stretched";
Height = "Fit";
Background = "Transparent";
- Foreground = "LightGray";
+ Foreground = "LightGrey";
MouseEnter = "{Background = vgradient|0:SteelBlue|1:Jet;Foreground=White;}";
- MouseLeave = "{Foreground=LightGray;Background=Transparent;}";
+ MouseLeave = "{Foreground=LightGrey;Background=Transparent;}";
SelectionBackground = "Transparent";
}
MessageBox {
AlwaysOnTop = "true";
}
Slider {
- Background = "vgradient|0:Black|0.1:Gray|0.9:Gray|1:LightGray";
- Foreground = "Gray";
+ Background = "vgradient|0:Black|0.1:Grey|0.9:Grey|1:LightGrey";
+ Foreground = "Grey";
Height = "10";
Value="5";
}
Splitter {
Focusable = "true";
Margin = "1";
- Background = "Gray";
+ Background = "Grey";
}
Spinner {
- Foreground = "DimGray";
+ Foreground = "DimGrey";
}
TabView {
CacheEnabled = "false";
Focusable = "true";
CacheEnabled = "true";
//MouseEnter = "{Background = Cobalt;Foreground=White;}";
- //MouseLeave = "{Foreground=LightGray;Background=Jet;}";
+ //MouseLeave = "{Foreground=LightGrey;Background=Jet;}";
AllowDrag = "true";
}
TextBox {
CheckBoxAlt {
Template= "#Crow.Templates.CheckBox2.template";
Background = "Transparent";
- Checked="{Background=Gray;Foreground=LightGray;}";
- Unchecked = "{Background=Transparent;Foreground=DimGray;}";
+ Checked="{Background=Grey;Foreground=LightGrey;}";
+ Unchecked = "{Background=Transparent;Foreground=DimGrey;}";
}
ArrowBut {
Width="Fit";
Focusable="true";
Foreground="Onyx";
- Background="hgradient|0:Gray|1:Jet";
+ Background="hgradient|0:Grey|1:Jet";
MouseDown="{Background=hgradient|0:White|0.4:CornflowerBlue|1:Jet}";
- MouseUp="{Background=hgradient|0:Gray|1:DimGray}";
+ MouseUp="{Background=hgradient|0:Grey|1:DimGrey}";
MouseEnter="{Foreground=Black}";
MouseLeave="{Foreground=Onyx}";
}
Width="Fit";
Focusable="true";
Foreground="Jet";
- Background="vgradient|0:Gray|1:DimGray";
+ Background="vgradient|0:Grey|1:DimGrey";
MouseDown="{Background=vgradient|0:White|0.4:DarkBlue|1:Jet}";
- MouseUp="{Background=vgradient|0:Gray|1:DimGray}";
+ MouseUp="{Background=vgradient|0:Grey|1:DimGrey}";
MouseEnter="{Foreground=Black}";
- MouseLeave="{Foreground=DimGray}";
+ MouseLeave="{Foreground=DimGrey}";
}
\ No newline at end of file
<?xml version="1.0"?>
<Border Name="Content"
- Background="vgradient|0:White|0.1:LightGray|0.9:LightGray|1:Black" Foreground="DarkGray"
+ Background="vgradient|0:White|0.1:LightGrey|0.9:LightGrey|1:Black" Foreground="DarkGrey"
MouseEnter="{Foreground=White}"
- MouseLeave="{Foreground=DarkGray}"
- MouseDown="{Background=vgradient|0:Black|0.1:LightGray|0.9:LightGray|1:White}"
- MouseUp="{Background=vgradient|0:White|0.1:LightGray|0.9:LightGray|1:Black}"
+ MouseLeave="{Foreground=DarkGrey}"
+ MouseDown="{Background=vgradient|0:Black|0.1:LightGrey|0.9:LightGrey|1:White}"
+ MouseUp="{Background=vgradient|0:White|0.1:LightGrey|0.9:LightGrey|1:Black}"
>
</Border>
<?xml version="1.0"?>
<Border Background="{./Background}" MinimumSize="50,20" Name="Content"
Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
- MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black;caption.Foreground=White}"
- MouseLeave="{Foreground=Transparent;caption.Foreground=LightGray}"
- MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
- MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black;caption.Foreground=White}"
+ MouseLeave="{Foreground=Transparent;caption.Foreground=LightGrey}"
+ MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
+ MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
>
- <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGray" Text="{./Caption}"/>
+ <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}"/>
</Border>
-<Border Foreground="Transparent" MouseEnter="{Foreground=Gray}" MouseLeave="{Foreground=Transparent}">
+<Border Foreground="Transparent" MouseEnter="{Foreground=Grey}" MouseLeave="{Foreground=Transparent}">
<Label Font="{./Font}" Text="{./Caption}"
Margin="1"
Background="{./Background}"
<Template>
<CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
<Template>
- <Border CornerRadius="0" Foreground="LightGray">
+ <Border CornerRadius="0" Foreground="LightGrey">
<HorizontalStack Margin="0" Spacing="1">
<TextBox MinimumSize="80,10" Margin="1" Foreground="Black" Background="White"
Text="{./Caption}"/>
</Template>
</CheckBox>
</Template>
- <Border Background="DimGray" BorderWidth="1" Margin="1"
+ <Border Background="DimGrey" BorderWidth="1" Margin="1"
MinimumSize="{../../MinimumPopupSize}" Fit="true">
<Scroller Name="scroller1" Margin="2"
MaximumSize="0,200"
Background="Red">
<Template>
<HorizontalStack>
- <Border Background="DimGray" Foreground="DimGray" CornerRadius="5">
+ <Border Background="DimGrey" Foreground="DimGrey" CornerRadius="5">
<GenericStack Orientation="{./Orientation}" Name="ItemsContainer"
Margin="2"/>
</Border>
<Template>
<Border Name="border1"
CornerRadius="2"
- MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
MouseLeave="{Foreground=Transparent}"
- MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
- MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
+ MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
MinimumSize = "60,0"
Foreground="Transparent"
Background="{./Background}">
Font="{./Font}" />
</Border>
</Template>
- <Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="DimGray">
+ <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="DimGrey">
<VerticalStack Name="ItemsContainer"/>
</Border>
</Popper>
SelectedItemChanged="./onSelectedItemChanged">
<ItemTemplate DataType="System.IO.FileInfo">
<Border CornerRadius="2" Margin="0" Focusable="true" Height="Fit" Width="Stretched" Foreground="Transparent"
- MouseEnter="{Foreground=DimGray}"
+ MouseEnter="{Foreground=DimGrey}"
MouseLeave="{Foreground=Transparent}">
<HorizontalStack>
<Image Margin="1" Width="14" Height="14"
<VerticalStack>
<Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand"
Foreground="Transparent"
- MouseEnter="{Foreground=DimGray}"
+ MouseEnter="{Foreground=DimGrey}"
MouseLeave="{Foreground=Transparent}">
<HorizontalStack Spacing="1">
<Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
Path="{./Image}"
Visible="{./IsExpandable}"
SvgSub="{./IsExpanded}"
- MouseEnter="{Background=LightGray}"
+ MouseEnter="{Background=LightGrey}"
MouseLeave="{Background=Transparent}"/>
<Image Margin="1" Width="14" Height="14"
Path="#Crow.Icons.folder.svg"/>
MouseEnter="./onBorderMouseEnter"
MouseLeave="./onBorderMouseLeave">
<VerticalStack Spacing="0">
- <HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="Gray">
+ <HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="Grey">
<Label Text="{./Caption}" TextAlignment="Left" Width="Stretched"
Foreground="Black" />
<Image Width="10" Height="10" Focusable="true" Margin="0" Path="#Crow.Images.Icons.exit2.svg"
<VerticalStack>
<HorizontalStack Spacing="1" Height="Fit" MouseDoubleClick="./onClickForExpand">
<Container Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
- MouseEnter="{Background=LightGray}"
+ MouseEnter="{Background=LightGrey}"
MouseLeave="{Background=Transparent}">
<Image
Path="#Crow.Images.Icons.expandable.svg"
<?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="DimGray">
+<Border BorderWidth="1" Foreground="DimGrey">
<GenericStack Orientation="{./Orientation}" Spacing="0">
<Shape Style="HArrowBut" MouseDown="./onScrollBack" Path="M 0.5,5.5 L 10.5,0.5 L 10.5,10.5 Z"/>
<Slider Name="Slider"
Height="{./HeightPolicy}" Width="{./WidthPolicy}"
LargeIncrement="{./LargeIncrement}"
SmallIncrement="{./SmallIncrement}"
- CursorColor="vgradient|0:Gray|1:DimGray"
- Foreground="DimGray"
- Background="vgradient|0:DimGray|0.1:Gray|0.95:Gray|1:White"/>
+ CursorColor="vgradient|0:Grey|1:DimGrey"
+ Foreground="DimGrey"
+ Background="vgradient|0:DimGrey|0.1:Grey|0.95:Grey|1:White"/>
<Shape Style="HArrowBut" MouseDown="./onScrollForth" Path="M 0.5,0.5 L 10.5,5.5 L 0.5,10.5 Z"/>
</GenericStack>
</Border>
\ No newline at end of file
<CheckBox IsChecked="{²./IsPopped}" Caption="{./Caption}" Background="{./Background}" Foreground="{./Foreground}">
<Template>
<Border Name="border1"
- MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
MouseLeave="{Foreground=Transparent}"
- MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
- MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
+ MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
MinimumSize = "60,0"
Foreground="Transparent"
Background="{./Background}">
</Template>
</CheckBox>
</Template>
- <Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="Jet">
+ <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="Jet">
<VerticalStack Name="ItemsContainer"/>
</Border>
</Popper>
<?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="DimGray">
+<Border BorderWidth="1" Foreground="Black" >
<GenericStack Orientation="{./Orientation}" Spacing="0">
- <Shape Style="ArrowBut" MouseDown="./onScrollBack" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"/>
+ <Shape Style="ArrowBut" MouseDown="./onScrollBack" Path="{./ScrollBackShape}"/>
<Slider Name="Slider"
Orientation="{./Orientation}"
Value="{²./Value}"
Height="{./HeightPolicy}" Width="{./WidthPolicy}"
LargeIncrement="{./LargeIncrement}"
SmallIncrement="{./SmallIncrement}"
- CursorColor="hgradient|0:Gray|1:DimGray"
- Foreground="DimGray"
- Background="hgradient|0:DimGray|0.1:Gray|0.95:Gray|1:White"/>
+ CursorColor="hgradient|0:Grey|1:Onyx"
+ Foreground="DimGrey"
+ Background="hgradient|0:Grey|1:White"/>
<Shape Style="ArrowBut" MouseDown="./onScrollForth" Path="M 0.5,0.5 L 10.5,0.5 L 5.5,10.5 Z"/>
</GenericStack>
</Border>
\ No newline at end of file
<GenericStack Orientation="Vertical" Spacing="0"
Background="{./Background}"
MouseEnter="{/caption.Foreground=White}"
- MouseLeave="{/caption.Foreground=Gray}">
+ MouseLeave="{/caption.Foreground=Grey}">
<HorizontalStack Margin="2" Left="{./TabOffset}"
Name="TabTitle"
HorizontalAlignment="Left"
Height="{./TabHeight}"
Width="{./TabWidth}">
- <Label Name="caption" Text="{./Caption}" Foreground="Gray"/>
+ <Label Name="caption" Text="{./Caption}" Foreground="Grey"/>
<Border CornerRadius="5" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"
MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
<Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg"
<?xml version="1.0" encoding="UTF-8" ?>
-<Border Fit="true" Foreground="DimGray" Background="Khaki">
- <Label Margin="3" Foreground="DimGray" Multiline="true" Text="{Tooltip}"/>
+<Border Fit="true" Foreground="DimGrey" Background="Khaki">
+ <Label Margin="3" Foreground="DimGrey" Multiline="true" Text="{Tooltip}"/>
</Border>
<?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="White" CornerRadius="{./CornerRadius}"
+<Border BorderWidth="1" Foreground="Grey" CornerRadius="{./CornerRadius}"
Background="{./Background}"
MouseEnter="./onBorderMouseEnter"
MouseLeave="./onBorderMouseLeave">
-//
-// BasicTests.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;
+using System.Runtime.InteropServices;
using Crow;
-using System.Collections.Generic;
-using System.Linq;
-using System.IO;
-using System.Reflection;
-using System.Text;
-using System.Diagnostics;
-
+using System.Threading;
-namespace Tests
+namespace tests
{
- class BasicTests : CrowWindow
+ class MainClass
{
- public BasicTests ()
- : base(800, 600,"test: press <F3> to toogle test files")
- {
- }
-
- int idx = 0;
- string[] testFiles;
-
- public Version CrowVersion {
- get {
- return System.Reflection.Assembly.GetAssembly(typeof(GraphicObject)).GetName().Version;
- }
- }
-
- #region Test values for Binding
- public List<Crow.Command> Commands;
- public int intValue = 500;
- DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
- //DirectoryInfo curDir = new DirectoryInfo (@"/mnt/data/Images");
- public FileSystemInfo[] CurDirectory {
- get { return curDir.GetFileSystemInfos (); }
- }
- public int IntValue {
- get {
- return intValue;
- }
- set {
- intValue = value;
- NotifyValueChanged ("IntValue", intValue);
- }
- }
- void onSpinnerValueChange(object sender, ValueChangeEventArgs e){
- if (e.MemberName != "Value")
- return;
- intValue = Convert.ToInt32(e.NewValue);
- }
- void change_alignment(object sender, EventArgs e){
- RadioButton rb = sender as RadioButton;
- if (rb == null)
- return;
- NotifyValueChanged ("alignment", Enum.Parse(typeof(Alignment), rb.Caption));
- }
- public IList<String> List2 = new List<string>(new string[]
- {
- "string1",
- "string2",
- "string3",
-// "string4",
-// "string5",
-// "string6",
-// "string7",
-// "string8",
-// "string8",
-// "string8",
-// "string8",
-// "string8",
-// "string8",
-// "string9"
- }
- );
- public IList<String> TestList2 {
- set{
- List2 = value;
- NotifyValueChanged ("TestList2", testList);
- }
- get { return List2; }
- }
- List<Color> testList = Color.ColorDic.Values//.OrderBy(c=>c.Hue)
- //.ThenBy(c=>c.Value).ThenBy(c=>c.Saturation)
- .ToList();
- public List<Color> TestList {
- set{
- testList = value;
- NotifyValueChanged ("TestList", testList);
- }
- get { return testList; }
- }
- string curSources = "";
- public string CurSources {
- get { return curSources; }
- set {
- if (value == curSources)
- return;
- curSources = value;
- NotifyValueChanged ("CurSources", curSources);
- }
- }
- bool boolVal = true;
- public bool BoolVal {
- get { return boolVal; }
- set {
- if (boolVal == value)
- return;
- boolVal = value;
- NotifyValueChanged ("BoolVal", boolVal);
- }
- }
-
- #endregion
-
- void OnClear (object sender, MouseButtonEventArgs e) => TestList = null;
-
- void OnLoadList (object sender, MouseButtonEventArgs e) => TestList =
- Color.ColorDic.Values.OrderBy(c=>c.Hue).ToList();
-
- void command1(){
- Console.WriteLine("command1 triggered");
- }
- void command2(){
- Console.WriteLine("command2 triggered");
- }
- void command3(){
- Console.WriteLine("command3 triggered");
- }
- void command4(){
- Console.WriteLine("command4 triggered");
- }
-
- protected override void OnLoad (EventArgs e)
+ public static void Main(string[] args)
{
- base.OnLoad (e);
-//
-// foreach (Color c in Color.ColorDic.Values) {
-// if (string.IsNullOrEmpty(c.htmlCode))
-// Console.WriteLine ("no htmlcode for {0}", c.Name);
-// else if (c.htmlCode.Substring(1) != c.HtmlCode)
-// Console.WriteLine ("{2} orig: {0} comp: {1}",c.htmlCode, c.HtmlCode, c.Name);
-// }
-
-
- Commands = new List<Crow.Command> (new Crow.Command[] {
- new Crow.Command(new Action(() => command1())) { Caption = "command1"},
- new Crow.Command(new Action(() => command2())) { Caption = "command2"},
- new Crow.Command(new Action(() => command3())) { Caption = "command3"},
- new Crow.Command(new Action(() => command4())) { Caption = "command4"},
- });
-
- this.KeyDown += KeyboardKeyDown1;
-
- //testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" };
- testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
- //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray ();
- //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Experimental", "*.crow")).ToArray ();
-
- Load(testFiles[idx]).DataSource = this;
-
-// LoadIMLFragment (@"<DockWindow Width=""150"" Height=""150"" Background=""DarkRed"" />", 0);
-// LoadIMLFragment (@"<DockWindow Width=""200"" Height=""150"" Background=""DarkGreen"" />", 0);
-// LoadIMLFragment (@"<DockWindow Width=""250"" Height=""150"" Background=""Brown"" />", 0);
-// LoadIMLFragment (@"<DockWindow Width=""300"" Height=""150"" Background=""DarkBlue"" />", 0);
-
-
- }
- void KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
+ using (Interface app = new Interface ()) {
+ // XWindow win = new XWindow (app);
+ // win.Show ();
+ //app.LoadIMLFragment (@"<SimpleGauge Level='40' Margin='5' Background='Jet' Foreground='Grey' Width='30' Height='50%'/>");
+
+ app.KeyboardKeyDown += App_KeyboardKeyDown;
+
+ //app.AddWidget (@"Interfaces/Divers/0.crow").DataSource = app;
+ //app.AddWidget (@"Interfaces/Splitter/1.crow").DataSource = app;
+ app.AddWidget (@"Interfaces/Container/0.crow").DataSource = app;
+ //app.AddWidget (@"Interfaces/Divers/colorPicker.crow").DataSource = app;
+ //app.AddWidget ("Interfaces/Divers/perfMeasures.crow").DataSource = app;
+
+ while (true) {
+ #if MEASURE_TIME
+ foreach (PerformanceMeasure m in app.PerfMeasures)
+ m.NotifyChanges ();
+ #endif
+ Thread.Sleep(10);
+ }
+ }
+ /*using (Display disp = new Display())
+ {
+ Window win = new Window(disp);
+ bool running = true;
+
+ while (running) {
+ IntPtr evt = disp.NextEvent;
+
+ switch ((EventType)Marshal.ReadInt32(evt))
+ {
+ case EventType.KeyPress:
+ running = false;
+ break;
+ }
+ }
+ }*/
+ }
+
+ static void App_KeyboardKeyDown (object sender, KeyboardKeyEventArgs e)
{
- try {
-
- if (e.Key == OpenTK.Input.Key.Escape) {
- Quit (null, null);
- return;
- } else if (e.Key == OpenTK.Input.Key.F1) {
- TestList.Add ("new string");
- NotifyValueChanged ("TestList", TestList);
- return;
- } else if (e.Key == OpenTK.Input.Key.F4) {
- GraphicObject w = Load ("Interfaces/TemplatedContainer/testWindow.goml");
- w.DataSource = this;
- return;
- } else if (e.Key == OpenTK.Input.Key.F5) {
- GraphicObject w = Load ("Interfaces/Divers/testFileDialog.crow");
- w.DataSource = this;
- return;
- }else if (e.Key == OpenTK.Input.Key.F6) {
- GraphicObject w = Load ("Interfaces/Divers/0.crow");
- w.DataSource = this;
- return;
- }else if (e.Key == OpenTK.Input.Key.F7) {
- GraphicObject w = Load ("Interfaces/Divers/perfMeasures.crow");
- w.DataSource = this.ifaceControl[0];
- return;
- } else if (e.Key == OpenTK.Input.Key.F2)
- idx--;
- else if (e.Key == OpenTK.Input.Key.F3)
- idx++;
- else
- return;
-
- ClearInterface ();
-
- if (idx == testFiles.Length)
- idx = 0;
- else if (idx < 0)
- idx = testFiles.Length - 1;
-
- this.Title = testFiles [idx] + ". Press <F3> to cycle examples.";
-
- GraphicObject obj = Load (testFiles[idx]);
- obj.DataSource = this;
- } catch (Exception ex) {
- MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException.Message).Modal = true;
- }
- }
-// void Tv_SelectedItemChanged (object sender, SelectionChangeEventArgs e)
-// {
-// FileInfo fi = e.NewValue as FileInfo;
-// if (fi == null)
-// return;
-// if (fi.Extension == ".crow" || fi.Extension == ".goml") {
-// Instantiator i = new Instantiator(fi.FullName);
-// lock (ifaceControl.CrowInterface.UpdateMutex) {
-// (ifaceControl.CrowInterface.FindByName ("crowContainer") as Container).SetChild
-// (i.CreateInstance(ifaceControl.CrowInterface));
-// //CurSources = i.GetImlSourcesCode();
-// }
-// }
-// }
-// void onImlSourceChanged(Object sender, TextChangeEventArgs e){
-// Instantiator i;
-// try {
-// i = Instantiator.CreateFromImlFragment (e.Text);
-// } catch (Exception ex) {
-// Debug.WriteLine (ex);
-// return;
-// }
-// lock (ifaceControl.CrowInterface.UpdateMutex) {
-// (ifaceControl.CrowInterface.FindByName ("crowContainer") as Container).SetChild
-// (i.CreateInstance(ifaceControl.CrowInterface));
-// }
-// }
- void onButClick(object send, MouseButtonEventArgs e)
- {
- Console.WriteLine ("button clicked:" + send.ToString());
- }
- void onAddTabButClick(object sender, MouseButtonEventArgs e){
-
- TabView tv = FindByName("tabview1") as TabView;
- if (tv == null)
- return;
- //tv.AddChild (new TabItem (CurrentInterface) { Caption = "NewTab" });
- lock (CurrentInterface.UpdateMutex) {
- tv.AddChild (CurrentInterface.LoadIMLFragment
- (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>"));
- }
- }
- [STAThread]
- static void Main ()
- {
- #if DEBUG
- TextWriterTraceListener listener = new TextWriterTraceListener ("debug.log");
- Debug.Listeners.Add (listener);
- #endif
-
- Console.WriteLine ("starting example");
- BasicTests win = new BasicTests ();
- win.VSync = OpenTK.VSyncMode.Adaptive;
- win.Run (30);
- #if DEBUG
- listener.Dispose ();
- #endif
- }
- protected override void OnUpdateFrame (OpenTK.FrameEventArgs e)
- {
- base.OnUpdateFrame (e);
- string test = e.Time.ToString ();
- IntValue++;
- if (IntValue == 1000)
- IntValue = 0;
- NotifyValueChanged ("PropertyLessBinding", test);
- }
- void onNew(object sender, EventArgs e){
- Debug.WriteLine ("menu new clicked");
+ GraphicObject obj = sender as GraphicObject;
+ obj.IFace.AddWidget(@"Interfaces/Divers/0.crow");
}
}
}
--- /dev/null
+//
+// CrowDebugger.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 Tests
+{
+ public class CrowDebugger
+ {
+ public CrowDebugger ()
+ {
+ }
+ }
+}
+
+++ /dev/null
-//
-// CrowWindow.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;
-using System.Threading;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using System.Collections.Generic;
-
-namespace Crow
-{
- public class CrowWindow : GameWindow, IValueChange
- {
- #region IValueChange implementation
- public event EventHandler<ValueChangeEventArgs> ValueChanged;
- public virtual void NotifyValueChanged(string MemberName, object _value)
- {
- if (ValueChanged != null)
- ValueChanged.Invoke(this, new ValueChangeEventArgs(MemberName, _value));
- }
- #endregion
-
- #region FPS
- int frameCpt = 0;
- int _fps = 0;
-
- public int fps {
- get { return _fps; }
- set {
- if (_fps == value)
- return;
-
- _fps = value;
- #if MEASURE_TIME
- if (_fps > fpsMax) {
- fpsMax = _fps;
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));
- } else if (_fps < fpsMin) {
- fpsMin = _fps;
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));
- }
- #endif
- if (frameCpt % 3 == 0) {
- ValueChanged.Raise (this, new ValueChangeEventArgs ("fps", _fps));
- #if MEASURE_TIME
- foreach (PerformanceMeasure m in ifaceControl[0].PerfMeasures)
- m.NotifyChanges ();
- #endif
- }
- }
- }
-
- #if MEASURE_TIME
- public PerformanceMeasure glDrawMeasure = new PerformanceMeasure("OpenGL Draw", 10);
-
- public int fpsMin = int.MaxValue;
- public int fpsMax = 0;
-
- void resetFps ()
- {
- fpsMin = int.MaxValue;
- fpsMax = 0;
- _fps = 0;
- }
- #endif
-
- #endregion
-
- #region ctor
- public CrowWindow(int _width = 800, int _height = 600, string _title="Crow",
- int colors = 32, int depth = 24, int stencil = 0, int samples = 1,
- int major=3, int minor=3)
- : this(_width, _height, new OpenTK.Graphics.GraphicsMode(colors, depth, stencil, samples),
- _title,GameWindowFlags.Default,DisplayDevice.Default,
- major,minor,OpenTK.Graphics.GraphicsContextFlags.Default)
- {
- }
- public CrowWindow (int width, int height, OpenTK.Graphics.GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, OpenTK.Graphics.GraphicsContextFlags flags)
- : base(width,height,mode,title,options,device,major,minor,flags)
- {
- }
-
- #endregion
-
- protected Shader shader;
- public List<InterfaceControler> ifaceControl = new List<InterfaceControler>();
- int focusedIdx = -1, activeIdx = -2;
-
- // TODO:We should be able to set the current interface programmaticaly
- /// <summary>
- /// Gets the currently focused interface, focus could have been given by creation of new iface controler and
- /// not only by the mouse
- /// </summary>
- public Interface CurrentInterface {
- get {
- checkDefaultIFace ();
- return ifaceControl [focusedIdx].CrowInterface;
- }
- }
-
- void addInterfaceControler(InterfaceControler ifaceControler)
- {
- ifaceControler.CrowInterface.Quit += Quit;
- ifaceControler.CrowInterface.MouseCursorChanged += CrowInterface_MouseCursorChanged;
-
- ifaceControl.Add (ifaceControler);
- focusedIdx = ifaceControl.Count - 1;
- }
- void openGLDraw(){
- //save GL states
- bool blend, depthTest, cullFace;
- GL.GetBoolean (GetPName.Blend, out blend);
- GL.GetBoolean (GetPName.DepthTest, out depthTest);
- GL.GetBoolean (GetPName.CullFace, out cullFace);
- GL.Enable (EnableCap.Blend);
- GL.Disable (EnableCap.DepthTest);
- GL.Disable (EnableCap.CullFace);
-
- #if MEASURE_TIME
- glDrawMeasure.StartCycle();
- #endif
-
- shader.Enable ();
- for (int i = 0; i < ifaceControl.Count; i++) {
- shader.SetMVP (ifaceControl [i].InterfaceMVP);
- ifaceControl [i].OpenGLDraw ();
- }
-
- #if MEASURE_TIME
- glDrawMeasure.StopCycle();
- #endif
-
- //restore GL states
- if (!blend)
- GL.Disable (EnableCap.Blend);
- if (depthTest)
- GL.Enable (EnableCap.DepthTest);
- if (cullFace)
- GL.Enable (EnableCap.CullFace);
- }
-
- public void Quit (object sender, EventArgs e)
- {
- foreach (InterfaceControler ic in ifaceControl) {
- ic.Dispose ();
- }
- this.Exit ();
- }
- void CrowInterface_MouseCursorChanged (object sender, MouseCursorChangedEventArgs e)
- {
- this.Cursor = new MouseCursor(
- (int)e.NewCursor.Xhot,
- (int)e.NewCursor.Yhot,
- (int)e.NewCursor.Width,
- (int)e.NewCursor.Height,
- e.NewCursor.data);
- }
-
- #region Events
- //those events are raised only if mouse isn't in a graphic object
- public event EventHandler<OpenTK.Input.MouseWheelEventArgs> CrowMouseWheel;
- public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseUp;
- public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseDown;
- public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseClick;
- public event EventHandler<OpenTK.Input.MouseMoveEventArgs> CrowMouseMove;
- public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> CrowKeyDown;
- public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> CrowKeyUp;
-
- #endregion
-
- public ProjectiveIFaceControler Add3DInterface(int width, int height, Matrix4 ifaceModelMat){
- ProjectiveIFaceControler tmp = new ProjectiveIFaceControler (new Rectangle (0, 0, width, height), ifaceModelMat);
- addInterfaceControler (tmp);
- return tmp;
- }
- public GraphicObject AddWidget (string path)
- {
- GraphicObject tmp = Load (path);
- return tmp;
- }
- public GraphicObject AddWidget (GraphicObject g, int interfaceIdx = 0){
- checkDefaultIFace ();
- ifaceControl [interfaceIdx].CrowInterface.AddWidget (g);
- return g;
- }
-
- public void DeleteWidget (GraphicObject g, int interfaceIdx = 0){
- ifaceControl [interfaceIdx].CrowInterface.DeleteWidget (g);
- }
- /// <summary>
- /// check if a default interface exists, create one if not
- /// </summary>
- void checkDefaultIFace (){
- if (ifaceControl.Count == 0) {//create default orthogonal interface
- addInterfaceControler (new InterfaceControler (
- new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height)));
- focusedIdx = 0;
- }
- }
- /// <summary>
- /// Load the content of the IML file pointed by path and add it to the current interface
- /// graphic tree.
- /// </summary>
- /// <param name="path">the path of the IML file to load</param>
- /// <param name="interfaceIdx">interface index to bind to, a default one is created if none exists</param>
- public GraphicObject Load (string path, int interfaceIdx = 0){
- checkDefaultIFace();
- return ifaceControl [interfaceIdx].CrowInterface.AddWidget (path);
- }
- /// <summary>
- /// Load the content of the IML string passed as first argument and add it to the current interface
- /// graphic tree.
- /// </summary>
- /// <param name="path">a valid IML string</param>
- /// <param name="interfaceIdx">interface index to bind to, a default one is created if none exists</param>
- public void LoadIMLFragment (string imlFragment, int interfaceIdx = 0){
- checkDefaultIFace();
- ifaceControl [interfaceIdx].CrowInterface.LoadIMLFragment (imlFragment);
- }
-
- public GraphicObject FindByName (string nameToFind){
- for (int i = 0; i < ifaceControl.Count; i++) {
- GraphicObject tmp = ifaceControl [i].CrowInterface.FindByName (nameToFind);
- if (tmp != null)
- return tmp;
- }
- return null;
- }
- public void ClearInterface (int interfaceIdx = 0){
- ifaceControl [interfaceIdx].CrowInterface.ClearInterface ();
- }
- /// <summary>Override this method for your OpenGL rendering calls</summary>
- public virtual void OnRender(FrameEventArgs e)
- {
- }
- /// <summary>Override this method to customize clear method between frames</summary>
- public virtual void GLClear()
- {
- GL.Clear (ClearBufferMask.ColorBufferBit|ClearBufferMask.DepthBufferBit);
- }
-
- #region Game win overrides
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
-
- this.KeyPress += new EventHandler<OpenTK.KeyPressEventArgs>(OpenTKGameWindow_KeyPress);
- KeyDown += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyDown);
- KeyUp += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyUp);
-
- MouseWheel += new EventHandler<OpenTK.Input.MouseWheelEventArgs>(GL_Mouse_WheelChanged);
- MouseDown += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonDown);
- MouseUp += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonUp);
- MouseMove += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(GL_Mouse_Move);
-
- #if DEBUG
- Console.WriteLine("\n\n*************************************");
- Console.WriteLine("GL version: " + GL.GetString (StringName.Version));
- Console.WriteLine("GL vendor: " + GL.GetString (StringName.Vendor));
- Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion));
- Console.WriteLine("*************************************\n");
- #endif
-
- shader = new Shader ();
- shader.Enable ();
-
- GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- }
- protected override void OnUpdateFrame(FrameEventArgs e)
- {
- base.OnUpdateFrame(e);
- fps = (int)RenderFrequency;
-
- #if MEASURE_TIME
- if (frameCpt > 500) {
- resetFps ();
- frameCpt = 0;
-// #if DEBUG
-// GC.Collect();
-// GC.WaitForPendingFinalizers();
-// NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString());
-// #endif
- }
- #endif
-
- frameCpt++;
- }
- protected override void OnRenderFrame(FrameEventArgs e)
- {
- GLClear ();
-
- base.OnRenderFrame(e);
-
- OnRender (e);
- openGLDraw ();
-
-
- SwapBuffers ();
- }
- protected override void OnResize(EventArgs e)
- {
- base.OnResize (e);
- for (int i = 0; i < ifaceControl.Count; i++) {
- ifaceControl[i].ProcessResize(
- new Rectangle(
- 0,
- 0,
- this.ClientRectangle.Width,
- this.ClientRectangle.Height));
- }
- }
- #endregion
-
- #region Mouse and Keyboard Handling
- void update_mouseButtonStates(ref MouseState e, OpenTK.Input.MouseState otk_e){
- for (int i = 0; i < MouseState.MaxButtons; i++) {
- if (otk_e.IsButtonDown ((OpenTK.Input.MouseButton)i))
- e.EnableBit (i);
- }
- }
- protected virtual void GL_Mouse_Move(object sender, OpenTK.Input.MouseMoveEventArgs otk_e)
- {
- if (activeIdx == -2) {
- for (int i = 0; i < ifaceControl.Count; i++) {
- if (ifaceControl [i].ProcessMouseMove (otk_e.X, otk_e.Y)) {
- focusedIdx = i;
- return;
- }
- }
- } if (ifaceControl [focusedIdx].ProcessMouseMove (otk_e.X, otk_e.Y))
- return;
-
- CrowMouseMove.Raise (sender, otk_e);
- }
- protected virtual void GL_Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs otk_e)
- {
- activeIdx = -2;
- if (focusedIdx >= 0) {
- if (ifaceControl [focusedIdx].ProcessMouseButtonUp ((int)otk_e.Button))
- return;
- }
- CrowMouseUp.Raise (sender, otk_e);
- }
- protected virtual void GL_Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs otk_e)
- {
- activeIdx = focusedIdx;
- if (focusedIdx >= 0) {
- if (ifaceControl [focusedIdx].ProcessMouseButtonDown ((int)otk_e.Button))
- return;
- }
- CrowMouseDown.Raise (sender, otk_e);
- }
- protected virtual void GL_Mouse_WheelChanged(object sender, OpenTK.Input.MouseWheelEventArgs otk_e)
- {
- if (focusedIdx >= 0) {
- if (ifaceControl [focusedIdx].ProcessMouseWheelChanged (otk_e.DeltaPrecise))
- return;
- }
- CrowMouseWheel.Raise (sender, otk_e);
- }
-
- protected virtual void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e)
- {
- if (focusedIdx >= 0) {
- if (ifaceControl [focusedIdx].ProcessKeyDown((int)otk_e.Key))
- return;
- }
- CrowKeyDown.Raise (this, otk_e);
- }
- protected virtual void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e)
- {
- if (focusedIdx >= 0) {
- if (ifaceControl [focusedIdx].ProcessKeyUp((int)otk_e.Key))
- return;
- }
- CrowKeyUp.Raise (this, otk_e);
- }
- protected virtual void OpenTKGameWindow_KeyPress (object sender, OpenTK.KeyPressEventArgs e)
- {
- if (focusedIdx >= 0) {
- if (ifaceControl [focusedIdx].ProcessKeyPress (e.KeyChar))
- return;
- }
- //TODO:create keyboardkeypress evt
- }
- #endregion
- }
-}
+++ /dev/null
-//
-// Hello3D.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;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using Crow;
-
-namespace Tests
-{
- class Hello3D : CrowWindow
- {
- [STAThread]
- static void Main ()
- {
- Hello3D win = new Hello3D ();
- win.Run (30);
- }
-
- public Hello3D ()
- : base(800, 600,"Crow Test with OpenTK")
- {
- }
-
- public Matrix4 modelview, projection;
- public int[] viewport = new int[4];
- public Vector3 vEyeTarget = new Vector3(0f, 0f, 0f);
- public Vector3 vEye;
- public Vector3 vLookInit = Vector3.Normalize(new Vector3(-1.0f, -1.0f, 1.0f));
- public Vector3 vLook; // Camera vLook Vector
- public float zNear = 0.001f, zFar = 300.0f;
- public float fovY = (float)Math.PI / 4;
- public float eyeDist = 10.2f;
- public float viewZangle, viewXangle;
- public const float MoveSpeed = 0.02f;
- public const float RotationSpeed = 0.005f;
- public const float ZoomSpeed = 0.22f;
-
- vaoMesh cube;
- Texture texture;
- ProjectiveIFaceControler iface3D;
-
- void initGL(){
- GL.Enable (EnableCap.CullFace);
- GL.Enable (EnableCap.Blend);
- GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
-
- cube = vaoMesh.CreateCube ();
- texture = new Texture ("image/textest.png");
- }
-
- protected override void OnLoad (EventArgs e)
- {
- base.OnLoad (e);
-
- CrowMouseMove += HelloCube_MouseMove;
- CrowMouseWheel += Hello3D_MouseWheelChanged;
-
- iface3D = Add3DInterface (800, 800,
- Matrix4.CreateScale (6f) *
- Matrix4.CreateRotationX (MathHelper.PiOver2) *
- Matrix4.CreateTranslation (Vector3.UnitY * -1.1f));
- Load (@"Interfaces/Divers/0.crow").DataSource = this;
- initGL ();
- shader.Enable ();
- }
-
- protected override void OnResize (EventArgs e)
- {
- base.OnResize (e);
- UpdateViewMatrix ();
- }
-
- public override void OnRender (FrameEventArgs e)
- {
- base.OnRender (e);
-
- shader.SetMVP(modelview * projection);
-
- GL.BindTexture (TextureTarget.Texture2D, texture);
- cube.Render (BeginMode.Triangles);
- GL.BindTexture (TextureTarget.Texture2D, 0);
- }
-
- public void UpdateViewMatrix()
- {
- Rectangle r = this.ClientRectangle;
- GL.Viewport( r.X, r.Y, r.Width, r.Height);
- projection = Matrix4.CreatePerspectiveFieldOfView (fovY, r.Width / (float)r.Height, zNear, zFar);
- vLook = vLookInit.Transform(
- Matrix4.CreateRotationX (viewXangle)*
- Matrix4.CreateRotationZ (viewZangle));
- vLook.Normalize();
- vEye = vEyeTarget + vLook * eyeDist;
- modelview = Matrix4.LookAt(vEye, vEyeTarget, Vector3.UnitZ);
- GL.GetInteger(GetPName.Viewport, viewport);
-
- iface3D.UpdateView (projection, modelview, viewport, vEye);
- }
-
- void HelloCube_MouseMove(object sender, OpenTK.Input.MouseMoveEventArgs otk_e)
- {
- if (otk_e.Mouse.MiddleButton == OpenTK.Input.ButtonState.Pressed) {
- viewZangle -= (float)otk_e.XDelta * RotationSpeed;
- viewXangle -= (float)otk_e.YDelta * RotationSpeed;
- UpdateViewMatrix ();
- } else if (otk_e.Mouse.LeftButton == OpenTK.Input.ButtonState.Pressed) {
- return;
- } else if (otk_e.Mouse.RightButton == OpenTK.Input.ButtonState.Pressed) {
- Vector2 v2Look = vLook.Xy.Normalized ();
- Vector2 disp = v2Look.PerpendicularLeft * otk_e.XDelta * MoveSpeed +
- v2Look * otk_e.YDelta * MoveSpeed;
- vEyeTarget += new Vector3 (disp.X, disp.Y, 0);
- UpdateViewMatrix ();
- }
- }
- void Hello3D_MouseWheelChanged (object sender, OpenTK.Input.MouseWheelEventArgs e)
- {
- float speed = ZoomSpeed;
- //if (Keyboard[OpenTK.Input.Key.ControlLeft])
- // speed *= 20.0f;
-
- eyeDist -= e.Delta * speed;
- if (eyeDist < zNear)
- eyeDist = zNear;
- else if (eyeDist > zFar)
- eyeDist = zFar;
- UpdateViewMatrix ();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// HelloWorld.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;
-using Crow;
-using Tutorials;
-
-namespace Tests
-{
- class HelloWorld : CrowWindow
- {
- public HelloWorld ()
- : base(800, 600,"Crow Test with OpenTK")
- {
- }
-
- protected override void OnLoad (EventArgs e)
- {
- base.OnLoad (e);
- LoadIMLFragment (@"<SimpleGauge Level='40' Margin='5' Background='Jet' Foreground='Gray' Width='30' Height='50%'/>");
- }
-
- [STAThread]
- static void Main ()
- {
- HelloWorld win = new HelloWorld ();
- win.Run (30);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// InterfaceControler.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;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using System.Threading;
-using System.Collections.Generic;
-
-namespace Crow
-{
- public class ProjectiveIFaceControler : InterfaceControler {
- Matrix4 modelview;
- int[] viewport = new int[4];
- Vector3 vEyePosition;
-
- public Matrix4 ifaceModelMat;
- Point localMousePos;
-
- public ProjectiveIFaceControler(Rectangle ifaceBounds, Matrix4 _ifaceModelMat)
- : base(ifaceBounds){
- ifaceModelMat = _ifaceModelMat;
- }
-
- public override Matrix4 InterfaceMVP {
- get { return ifaceModelMat * modelview * projection; }
- }
-
- public override void initGL(){
- quad = new Crow.vaoMesh (0, 0, 0, 1, 1, 1, -1);
- //ifaceModelMat = Matrix4.CreateRotationX(MathHelper.PiOver2) * Matrix4.CreateTranslation(Vector3.UnitY);
- CrowInterface.ProcessResize(iRect);
- createContext ();
- //CrowInterface.ProcessResize (iRect);
- }
- public override void ProcessResize (Rectangle newSize)
- {
- }
- public override void OpenGLDraw ()
- {
- GL.Enable (EnableCap.DepthTest);
- base.OpenGLDraw ();
- GL.Disable (EnableCap.DepthTest);
- }
- public void UpdateView (Matrix4 _projection, Matrix4 _modelview, int[] _viewport, Vector3 _vEyePosition)
- {
- projection = _projection;
- modelview = _modelview;
- viewport = _viewport;
- vEyePosition = _vEyePosition;
- }
- public override bool ProcessMouseMove (int x, int y)
- {
- Matrix4 mv = ifaceModelMat * modelview;
- Vector3 vMouse = UnProject(ref projection, ref mv, viewport, new Vector2 (x, y)).Xyz;
- Vector3 vE = vEyePosition.Transform (ifaceModelMat.Inverted());
- Vector3 vMouseRay = Vector3.Normalize(vMouse - vE);
- float a = vE.Z / vMouseRay.Z;
- vMouse = vE - vMouseRay * a;
- //vMouse = vMouse.Transform (interfaceModelView.Inverted());
- localMousePos = new Point ((int)Math.Truncate ((vMouse.X + 0.5f) * iRect.Width),
- iRect.Height - (int)Math.Truncate ((vMouse.Y + 0.5f) * iRect.Height));
- mouseIsInInterface = localMousePos.X.IsInBetween (0, iRect.Width) & localMousePos.Y.IsInBetween (0, iRect.Height);
-
- return mouseIsInInterface ? CrowInterface.ProcessMouseMove (localMousePos.X, localMousePos.Y) : false;
- }
- Vector4 UnProject(ref Matrix4 projection, ref Matrix4 view, int[] viewport, Vector2 mouse)
- {
- Vector4 vec;
-
- vec.X = 2.0f * mouse.X / (float)viewport[2] - 1;
- vec.Y = -(2.0f * mouse.Y / (float)viewport[3] - 1);
- vec.Z = 0f;
- vec.W = 1.0f;
-
- Matrix4 viewInv = Matrix4.Invert(view);
- Matrix4 projInv = Matrix4.Invert(projection);
-
- Vector4.Transform(ref vec, ref projInv, out vec);
- Vector4.Transform(ref vec, ref viewInv, out vec);
-
- if (vec.W > float.Epsilon || vec.W < float.Epsilon)
- {
- vec.X /= vec.W;
- vec.Y /= vec.W;
- vec.Z /= vec.W;
- }
-
- return vec;
- }
- }
- public class InterfaceControler : IDisposable {
- public Interface CrowInterface;
- public int texID;
- public vaoMesh quad;
- public Rectangle iRect = new Rectangle(0,0,2048,2048);
- public bool mouseIsInInterface = false;
-
- protected Matrix4 projection;
- public virtual Matrix4 InterfaceMVP {
- get { return projection; }
- }
-
- #if MEASURE_TIME
- public List<PerformanceMeasure> PerfMeasures;
- public PerformanceMeasure glDrawMeasure = new PerformanceMeasure("OpenGL Draw", 10);
- #endif
-
- #region CTOR
- public InterfaceControler(Rectangle ifaceBounds){
- iRect = ifaceBounds;
-
- CrowInterface = new Interface ();
- CrowInterface.Init ();
-
- #if MEASURE_TIME
- PerfMeasures = new List<PerformanceMeasure> (
- new PerformanceMeasure[] {
- this.CrowInterface.updateMeasure,
- this.CrowInterface.layoutingMeasure,
- this.CrowInterface.clippingMeasure,
- this.CrowInterface.drawingMeasure,
- this.glDrawMeasure
- }
- );
- #endif
-
- Thread t = new Thread (interfaceThread);
- t.IsBackground = true;
- t.Start ();
-
- initGL ();
- }
- #endregion
-
- void interfaceThread()
- {
- while (CrowInterface.ClientRectangle.Size.Width == 0)
- Thread.Sleep (5);
-
- while (true) {
- CrowInterface.Update ();
- Thread.Sleep (2);
- }
- }
-
- #region Mouse And Keyboard handling
- public virtual void ProcessResize(Rectangle newSize){
- iRect = newSize;
- CrowInterface.ProcessResize(newSize);
- createContext ();
- GL.Viewport (0, 0, newSize.Width, newSize.Height);//TODO:find a better place for this
- }
- public virtual bool ProcessMouseMove(int x, int y){
- return CrowInterface.ProcessMouseMove (x, y);
- }
- public virtual bool ProcessMouseButtonUp(int button)
- {
- return CrowInterface.ProcessMouseButtonUp (button);
- }
- public virtual bool ProcessMouseButtonDown(int button)
- {
- return CrowInterface.ProcessMouseButtonDown (button);
- }
- public virtual bool ProcessMouseWheelChanged(float delta)
- {
- return CrowInterface.ProcessMouseWheelChanged (delta);
- }
- public virtual bool ProcessKeyDown(int Key){
- return CrowInterface.ProcessKeyDown(Key);
- }
- public virtual bool ProcessKeyUp(int Key){
- return CrowInterface.ProcessKeyUp(Key);
- }
- public virtual bool ProcessKeyPress(char Key){
- return CrowInterface.ProcessKeyPress(Key);
- }
- #endregion
-
- #region graphic context
- public virtual void initGL(){
- projection = OpenTK.Matrix4.CreateOrthographicOffCenter (-0.5f, 0.5f, -0.5f, 0.5f, 1, -1);
- quad = new Crow.vaoMesh (0, 0, 0, 1, 1, 1, -1);
- createContext ();
- }
- /// <summary>Create the texture for the interface redering</summary>
- public virtual void createContext()
- {
- if (GL.IsTexture(texID))
- GL.DeleteTexture (texID);
- GL.GenTextures(1, out texID);
- GL.ActiveTexture (TextureUnit.Texture0);
- GL.BindTexture(TextureTarget.Texture2D, texID);
-
- GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba,
- iRect.Width, iRect.Height, 0,
- OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, CrowInterface.bmp);
-
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
-
- GL.BindTexture(TextureTarget.Texture2D, 0);
- }
- /// <summary>Rendering of the interface</summary>
- public virtual void OpenGLDraw()
- {
- #if MEASURE_TIME
- glDrawMeasure.StartCycle();
- #endif
-
- GL.ActiveTexture (TextureUnit.Texture0);
- GL.BindTexture (TextureTarget.Texture2D, texID);
- if (Monitor.TryEnter(CrowInterface.RenderMutex)) {
- if (CrowInterface.IsDirty) {
- GL.TexSubImage2D (TextureTarget.Texture2D, 0,
- CrowInterface.DirtyRect.Left, CrowInterface.DirtyRect.Top,
- CrowInterface.DirtyRect.Width, CrowInterface.DirtyRect.Height,
- OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, CrowInterface.dirtyBmp);
- CrowInterface.IsDirty = false;
- }
- Monitor.Exit (CrowInterface.RenderMutex);
- }
- quad.Render (BeginMode.TriangleStrip);
- GL.BindTexture(TextureTarget.Texture2D, 0);
-
- #if MEASURE_TIME
- glDrawMeasure.StopCycle();
- #endif
- }
- #endregion
-
- #region IDisposable implementation
-
- public void Dispose ()
- {
- if (GL.IsTexture(texID))
- GL.DeleteTexture (texID);
- if (quad != null)
- quad.Dispose ();
- }
-
- #endregion
- }
-}
-
<Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
Margin="3"
Background="{./Background}"
- Foreground="DimGray"
+ Foreground="DimGrey"
TextAlignment="Center"
MouseEnter="{Foreground=White}"
- MouseLeave="{Foreground=DimGray}"/>
\ No newline at end of file
+ MouseLeave="{Foreground=DimGrey}"/>
\ No newline at end of file
<?xml version="1.0"?>
-<Container Background="DimGray" Margin="10" Width="90%" Height="90%">
+<Container Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Background="SeaGreen"
MinimumSize="50,50"/>
</Container>
\ No newline at end of file
<?xml version="1.0"?>
-<Container Background="DimGray" Margin="10" Fit="true">
+<Container Background="DimGrey" Margin="10" Fit="true">
<Label Text="{fps}" Margin="10" Fit="true" Background="SeaGreen"/>
</Container>
\ No newline at end of file
<HorizontalStack >
<VerticalStack Width="30%" Margin="5">
<GroupBox Caption="Performance" Height="Fit">
- <VerticalStack Width="90%" Height="Fit" Spacing="2" >
+ <VerticalStack DataSource="{drawingMeasure}" Width="90%" Height="Fit" Spacing="2" >
<HorizontalStack Height="Fit" Tooltip="Frame per second">
<Label Text="Fps:" Style="FpsLabel"/>
- <Label Text="{fps}" Style="FpsDisp"/>
+ <Label Text="{minimum}" Style="FpsDisp"/>
</HorizontalStack>
<HorizontalStack Height="Fit" Tooltip="Minimum Frame per second">
<Label Text="Min:" Style="FpsLabel"/>
</HorizontalStack>
</VerticalStack>
</GroupBox>
- <Label Width="Stretched" Margin="3" Background="DimGray"/>
+ <Label Width="Stretched" Margin="3" Background="DimGrey"/>
<TextBox Text="TextBox" Multiline="true" Margin="3"/>
- <HorizontalStack Height="Fit" Margin="5" Background="DimGray" CornerRadius="10">
+ <HorizontalStack Height="Fit" Margin="5" Background="DimGrey" CornerRadius="10">
<VerticalStack Spacing="5" Width="50%">
<CheckBox Fit="true" Caption="test"/>
<CheckBox Fit="true"/>
<HorizontalStack Height="Fit" Margin="5">
<Label Text="MouseEvents" Width="50%" Margin="3"
Background="Jet"
- Foreground="DimGray"
+ Foreground="DimGrey"
TextAlignment="Center"
MouseEnter="{Foreground=White}"
- MouseLeave="{Foreground=DimGray}"
+ MouseLeave="{Foreground=DimGrey}"
MouseDown="{Background=DarkRed}"
MouseClick="{Foreground=Green}"
MouseDoubleClick="{Foreground=Yellow}"
MouseUp="{Background=Jet}"/>
<Label Text="MouseEvents" Width="50%" Margin="3"
Background="Jet"
- Foreground="DimGray"
+ Foreground="DimGrey"
TextAlignment="Center"
MouseClick="{Foreground=Green}"
MouseDoubleClick="{Foreground=Yellow}"
MouseEnter="{Foreground=White}"
- MouseLeave="{Foreground=DimGray}"
+ MouseLeave="{Foreground=DimGrey}"
MouseDown="{Background=SeaGreen}"
- MouseUp="{Background=DimGray}"/>
+ MouseUp="{Background=DimGrey}"/>
</HorizontalStack>
<GroupBox Caption="Templated controls" Height="Fit" Margin="5">
<HorizontalStack Height="Fit">
<Image Path="#Crow.Images.Icons.crow.svg"/>
</Expandable>
<Popper>
- <Border Fit="True" Background="DimGray" CornerRadius="0" BorderWidth="1">
+ <Border Fit="True" Background="DimGrey" CornerRadius="0" BorderWidth="1">
<Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10"
- MouseEnter="{Background=LightGray}"
+ MouseEnter="{Background=LightGrey}"
MouseLeave="{Background=Transparent}"/>
</Border>
</Popper>
<Slider Height="10" Width="90%"/>
- <Container Height="Fit" Width="200" Background="DimGray" Margin="2" CornerRadius="5">
- <ProgressBar Background="DimGray" Height="10" Value="50"/>
+ <Container Height="Fit" Width="200" Background="DimGrey" Margin="2" CornerRadius="5">
+ <ProgressBar Background="DimGrey" Height="10" Value="50"/>
</Container>
- <Image Path="#Crow.Images.Icons.crow.svg" Width="60" Height="60" Background="LightGray" />
+ <Image Path="#Crow.Images.Icons.crow.svg" Width="60" Height="60" Background="LightGrey" />
<!-- <TabView Name="tabview1"
Height="120" Orientation="Horizontal" Spacing="15">
<TabItem Name="TabItem1" Caption="Tab 1" Margin="0">
<CheckBox/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem2" Caption="Tab 2" Background="Gray">
+ <TabItem Name="TabItem2" Caption="Tab 2" Background="Grey">
<VerticalStack Fit="true">
<RadioButton/>
<RadioButton/>
<RadioButton/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem3" Caption="Tab 3" Background="Gray">
+ <TabItem Name="TabItem3" Caption="Tab 3" Background="Grey">
<Container Margin="5" CornerRadius="2">
<TextBox Height="Stretched" Margin="5" Multiline="true" TextAlignment="TopLeft"/>
</Container>
<?xml version="1.0"?>
<HorizontalStack Fit="true">
<VerticalStack Fit="true" Name="vsFps" Spacing="10" >
- <ProgressBar CornerRadius="5" Background="DimGray" Margin="1" Maximum="1000" Value="{fps}" Width="200" Height="15"/>
+ <ProgressBar CornerRadius="5" Background="DimGrey" Margin="1" Maximum="1000" Value="{fps}" Width="200" Height="15"/>
<HorizontalStack Fit="true">
<Label Text="Memory:" Width="50" TextAlignment="Right"/>
<Label Text="{memory}" Font="droid,12" TextAlignment="Center"
<GroupBox Caption="Group box" >
<Label Text="border test" Margin="3"/>
</GroupBox>
- <Container Fit="true" Background="DimGray" Margin="3">
- <GraphicObject Width="20" Height="20" Background="LightGray"/>
+ <Container Fit="true" Background="DimGrey" Margin="3">
+ <GraphicObject Width="20" Height="20" Background="LightGrey"/>
</Container>-->
-<!-- <ProgressBar Height="10" Width="150" Background="DimGray" Value="50" />
+<!-- <ProgressBar Height="10" Width="150" Background="DimGrey" Value="50" />
<Slider Value="5" Width="150" Height="10"/>
<ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="150"/>
<Spinner Value="100"/>-->
<GroupBox Caption="Group box" Width="Stretched">
<Label Text="border test" Margin="3"/>
</GroupBox>
- <Container Height="Fit" Width="Stretched" Background="DimGray" Margin="3">
- <GraphicObject Width="20" Height="20" Background="LightGray"/>
+ <Container Height="Fit" Width="Stretched" Background="DimGrey" Margin="3">
+ <GraphicObject Width="20" Height="20" Background="LightGrey"/>
</Container>
- <ProgressBar Height="10" Width="Stretched" Background="DimGray" Value="50" />
+ <ProgressBar Height="10" Width="Stretched" Background="DimGrey" Value="50" />
<Slider Value="5" Width="Stretched" Height="10"/>
<ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="Stretched"/>
<Spinner Value="100" Width="Stretched"/>
<?xml version="1.0"?>
-<VerticalStack Fit="true" Background="DimGray" Margin="5">
+<VerticalStack Fit="true" Background="DimGrey" Margin="5">
<!-- <RadioButton/>-->
<Label Text="a" Width="Stretched" Background="Red"/>
<Label Text="{fps}" HorizontalAlignment="Right" Background="LimeGreen"/>
<?xml version="1.0"?>
<Container Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=Gray}"
+ MouseEnter="{Background=Grey}"
MouseLeave="{Background=LimeGreen}">
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="false"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{drawing}" Background="RoyalBlue"/>
</Container>
\ No newline at end of file
<?xml version="1.0"?>
<Container Fit="true" Margin="20" Background="SkyBlue" CacheEnabled="false"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=LightGray}"
+ MouseEnter="{Background=LightGrey}"
MouseLeave="{Background=SkyBlue}">
<Container Fit="true" Margin="20" Background="Red" CacheEnabled="true"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
MouseLeave="{Background=Yellow}">
<Container Margin="50" Background="LimeGreen" CacheEnabled="true"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=Gray}"
+ MouseEnter="{Background=Grey}"
MouseLeave="{Background=LimeGreen}">
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}"
+ MouseEnter="{Background=DimGrey}"
MouseLeave="{Background=RoyalBlue}"
Margin="1" Text="{drawing}" Background="RoyalBlue"/>
</Container>
<?xml version="1.0"?>
<Group Fit="true" Margin="50" Background="Yellow" CacheEnabled="true"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=DimGray}"
+ MouseEnter="{Background=DimGrey}"
MouseLeave="{Background=Yellow}">
<Group Width="300" Height="200" Margin="50" Background="LimeGreen" CacheEnabled="false"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=Gray}"
+ MouseEnter="{Background=Grey}"
MouseLeave="{Background=LimeGreen}">
<Label Left="10" HorizontalAlignment="Right" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{drawing}" Background="RoyalBlue"/>
</Group>
<?xml version="1.0"?>
<Group Fit="true" Margin="50" Background="Yellow" CacheEnabled="true"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=DimGray}"
+ MouseEnter="{Background=DimGrey}"
MouseLeave="{Background=Yellow}">
<HorizontalStack Fit="true">
<VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=Gray}"
+ MouseEnter="{Background=Grey}"
MouseLeave="{Background=LimeGreen}">
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{fps}" Background="RoyalBlue"/>
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{drawing}" Background="RoyalBlue"/>
</VerticalStack>
<VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=Gray}"
+ MouseEnter="{Background=Grey}"
MouseLeave="{Background=LimeGreen}">
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{fpsMax}" Background="RoyalBlue"/>
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{fpsMin}" Background="RoyalBlue"/>
</VerticalStack>
<?xml version="1.0"?>
<Border Fit="true" BorderWidth="2" >
-<Scroller CornerRadius="2" Height="200" Width="300" Background="DimGray" Margin="2">
+<Scroller CornerRadius="2" Height="200" Width="300" Background="DimGrey" Margin="2">
<VerticalStack Margin="10" VerticalAlignment="Top" Fit="true" Background="vgradient|0:RoyalBlue|1:Black" >
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 1"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 2"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 3"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 4"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 5"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 6"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 7"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 8"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 9"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 10"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 11"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 12"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 13"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 14"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 15"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 16"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 17"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 18"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 19"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 20"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 21"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 22"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 23"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 24"/>
- <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 25"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 1"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 2"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 3"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 4"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 5"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 6"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 7"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 8"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 9"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 10"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 11"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 12"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 13"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 14"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 15"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 16"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 17"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 18"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 19"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 20"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 21"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 22"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 23"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 24"/>
+ <Label MouseEnter="{Background=Grey}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 25"/>
</VerticalStack>
</Scroller>
</Border>
<!--<VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
- MouseEnter="{Background=Gray}"
+ MouseEnter="{Background=Grey}"
MouseLeave="{Background=LimeGreen}">
<CheckBox Margin="20" Background="RoyalBlue"/>
<CheckBox/>
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{fps}" Background="RoyalBlue"/>
<Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
- MouseEnter="{Background=DimGray}" Width="100"
+ MouseEnter="{Background=DimGrey}" Width="100"
MouseLeave="{Background=RoyalBlue}"
Margin="10" Text="{drawing}" Background="RoyalBlue"/>
</VerticalStack>-->
\ No newline at end of file
<?xml version="1.0"?>
<VerticalStack>
- <ColorPicker SelectedColor="{²../go.Background}" Name="colorPicker" Background="DimGray" Margin="5" Fit="True" />
+ <ColorPicker SelectedColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Margin="5" Fit="True" />
<GraphicObject Name="go" Width="100" Height="60" Background="DarkBlue"/>
<GraphicObject Name="go" Width="100" Height="60" Background="{../colorPicker.SelectedColor}"/>
<Label Text="{../colorPicker.SelectedColor}"/>
<?xml version="1.0"?>
-<Window Focusable="true" Caption="Measures" Width="30%" Height="Fit" MinimumSize="100,100">
+<Window Focusable="true" Caption="Measures" Width="30%" Height="300" MinimumSize="100,100">
<ListBox Data="{PerfMeasures}"
ItemTemplate="#Tests.Interfaces.perfMsr.crow"/>
</Window>
<Label Text="{fps}" IsEnabled="true" Font="30"/>
<Label Text="{fps}" IsEnabled="false" Font="30" Background="SeaGreen"/>
<Label Text="{fps}" IsEnabled="true" Font="30" Background="SeaGreen"/>
- <Button Caption="Button" IsEnabled="true" Background="Gray"/>
- <Button Caption="Button" IsEnabled="false" Background="Gray"/>
+ <Button Caption="Button" IsEnabled="true" Background="Grey"/>
+ <Button Caption="Button" IsEnabled="false" Background="Grey"/>
<Button Caption="Button" IsEnabled="true" />
<Button Caption="Button" IsEnabled="false" />
<Spinner Fit="true"/>
<?xml version="1.0"?>
-<Container Width="200" Height="100" Background="DimGray" Margin="5">
+<Container Width="200" Height="100" Background="DimGrey" Margin="5">
<Container Width="Stretched" Height="800" Background="DarkBlue">
<Label Text="{fps}" Background="RoyalBlue" VerticalAlignment="Center"/>
</Container>
<?xml version="1.0"?>
-<Label Margin="50" MinimumSize="10,10" Background="DimGray" Text="{PropertyLessBinding}"/>
\ No newline at end of file
+<Label Margin="50" MinimumSize="10,10" Background="DimGrey" Text="{PropertyLessBinding}"/>
\ No newline at end of file
<?xml version="1.0"?>
<Container Fit="true" Background="Red" Tooltip="test tooltip" >
- <Shape Foreground="Transparent" Background="DimGray" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"
- MouseEnter="{Background=hgradient|0:DimGray|0.5:RoyalBlue|1:Black}"
- MouseLeave="{Background=DimGray}"/>
+ <Shape Foreground="Transparent" Background="DimGrey" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"
+ MouseEnter="{Background=hgradient|0:DimGrey|0.5:RoyalBlue|1:Black}"
+ MouseLeave="{Background=DimGrey}"/>
</Container>
\ No newline at end of file
<?xml version="1.0"?>
<Window Width="500" Height="300" MinimumSize="50,50">
-<HorizontalStack Margin="5" Background="DimGray">
- <VerticalStack Width="200" Margin="5" Background="Gray">
- <VerticalStack Fit="true" Background="DimGray" Margin="5">
+<HorizontalStack Margin="5" Background="DimGrey">
+ <VerticalStack Width="200" Margin="5" Background="Grey">
+ <VerticalStack Fit="true" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</VerticalStack>
- <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
+ <VerticalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue" Width="Stretched"/>
<TextRun Background="SkyBlue" Height="Stretched"/>
</VerticalStack>
- <HorizontalStack Fit="true" Background="DimGray" Margin="5">
+ <HorizontalStack Fit="true" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
+ <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5">
+ <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue" Width="Stretched"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
</VerticalStack>
- <VerticalStack Width="Stretched" Height="Stretched" Margin="5" Background="Gray">
- <VerticalStack Fit="true" Background="DimGray" Margin="5">
+ <VerticalStack Width="Stretched" Height="Stretched" Margin="5" Background="Grey">
+ <VerticalStack Fit="true" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</VerticalStack>
- <VerticalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5">
+ <VerticalStack Width="Stretched" Height="Stretched" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue" Width="Stretched"/>
<TextRun TextAlignment="Center" Background="SkyBlue" Width="Stretched" Height="Stretched"/>
</VerticalStack>
- <HorizontalStack Fit="true" Background="DimGray" Margin="5">
+ <HorizontalStack Fit="true" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
+ <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
+ <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue" Width="Stretched"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
</VerticalStack>
- <VerticalStack Width="Fit" Margin="5" Background="Gray">
- <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
+ <VerticalStack Width="Fit" Margin="5" Background="Grey">
+ <VerticalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue" HorizontalAlignment="Left"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</VerticalStack>
- <VerticalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
+ <VerticalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue" Width="Stretched"/>
<TextRun Background="SkyBlue" Height="Stretched"/>
</VerticalStack>
- <HorizontalStack Fit="true" Background="DimGray" Margin="5">
+ <HorizontalStack Fit="true" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Fit" Background="DimGray" Margin="5">
+ <HorizontalStack Width="Stretched" Height="Fit" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue"/>
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGray" Margin="5">
+ <HorizontalStack Width="Stretched" Height="Stretched" Background="DimGrey" Margin="5">
<TextRun Background="SkyBlue"/>
<TextRun Background="SkyBlue" Width="Stretched"/>
<TextRun Background="SkyBlue"/>
<?xml version="1.0"?>
<VerticalStack Background="SteelBlue" Fit="true">
<HorizontalStack Fit="true">
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="TopLeft"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Top"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="TopRight"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Left"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Center"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Right"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="BottomLeft"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Bottom"/>
- <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="BottomRight"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="TopLeft"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Top"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="TopRight"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Left"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Center"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Right"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="BottomLeft"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="Bottom"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" TextAlignment="BottomRight"/>
</HorizontalStack>
<HorizontalStack Fit="true">
- <TextBox Background="DarkGray" Height="30" Width="70" TextAlignment="Top" HorizontalStretch="true" Text="TopStretch"/>
- <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="Center" HorizontalStretch="true" Text="HorizontalStretch" />
- <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="Bottom" HorizontalStretch="true" Text="BottomStretch"/>
- <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Left" VerticalStretch="true" Text="LeftStretch"/>
- <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Center" VerticalStretch="true" Text="VerticalStretch"/>
- <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Right" VerticalStretch="true" Text="RightStretch"/>
- <TextBox Background="DarkGray" Height="30" Width="50" HorizontalStretch="true" VerticalStretch="true" Text="Fit"/>
+ <TextBox Background="DarkGrey" Height="30" Width="70" TextAlignment="Top" HorizontalStretch="true" Text="TopStretch"/>
+ <TextBox Background="DarkGrey" Height="30" Width="60" TextAlignment="Center" HorizontalStretch="true" Text="HorizontalStretch" />
+ <TextBox Background="DarkGrey" Height="30" Width="60" TextAlignment="Bottom" HorizontalStretch="true" Text="BottomStretch"/>
+ <TextBox Background="DarkGrey" Height="10" Width="70" TextAlignment="Left" VerticalStretch="true" Text="LeftStretch"/>
+ <TextBox Background="DarkGrey" Height="10" Width="70" TextAlignment="Center" VerticalStretch="true" Text="VerticalStretch"/>
+ <TextBox Background="DarkGrey" Height="10" Width="70" TextAlignment="Right" VerticalStretch="true" Text="RightStretch"/>
+ <TextBox Background="DarkGrey" Height="30" Width="50" HorizontalStretch="true" VerticalStretch="true" Text="Fit"/>
</HorizontalStack>
<TextBox Name="tb" Multiline="true" Font="droid,16" Margin="5" Text="A\nBB\nCCC\nDDDD"/>
<TextBox Multiline="true" Font="droid,16" Name="tb5" Margin="5" Text="{../tb.SelectedText}"/>
<Label Foreground="Black" Font="mono, 12" Text="."/>
<Label Foreground="Black" Font="mono, 12" Text="{Minor}"/>
<Label Foreground="Black" Font="mono, 12" Text="."/>
- <Label Foreground="DimGray" Font="mono, 12" Text="{Build}"/>
+ <Label Foreground="DimGrey" Font="mono, 12" Text="{Build}"/>
</HorizontalStack>
<GraphicObject Height="30"/>
<Label Font="20" Text="Press <F2> and <F3> to cycle into the examples"/>
<Label Font="20" Text="Those are basic tests used to validate changes,"/>
<GraphicObject Height="30"/>
- <Label Foreground="DimGray" Font="20" Text="<F5> => File dialog example"/>
- <Label Foreground="DimGray" Font="20" Text="<F6> => Window example"/>
+ <Label Foreground="DimGrey" Font="20" Text="<F5> => File dialog example"/>
+ <Label Foreground="DimGrey" Font="20" Text="<F6> => Window example"/>
</VerticalStack>
</Border>
\ No newline at end of file
<?xml version="1.0"?>
-<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="90%" Spacing="100" Focusable="true">
- <Container Name="source" StartDrag="{Background=DimGray}" EndDrag="{Background=SeaGreen}" Focusable="true" Fit="true"
+<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="90%" Spacing="100" Focusable="true">
+ <Container Name="source" StartDrag="{Background=DimGrey}" EndDrag="{Background=SeaGreen}" Focusable="true" Fit="true"
Drop="{../target.Background=Green}"
MouseEnter="{/txt.Foreground=Red}" MouseLeave="{/txt.Foreground=White}" MouseClick="{Background=SeaGreen}"
AllowDrag="true" Width="200" Height="200" Background="SeaGreen">
<VerticalStack Margin="50">
- <Label Name="txt" Text="Drag me" Foreground="Gray"/>
- <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Gray"/>
+ <Label Name="txt" Text="Drag me" Foreground="Grey"/>
+ <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Grey"/>
</VerticalStack>
</Container>
- <Container Name="target" DragEnter="{Background=SeaGreen}" DragLeave="{Background=DimGray}" Focusable="true" Fit="true"
+ <Container Name="target" DragEnter="{Background=SeaGreen}" DragLeave="{Background=DimGrey}" Focusable="true" Fit="true"
MouseEnter="{/txt.Foreground=Red}" MouseLeave="{/txt.Foreground=White}"
- AllowDrop="true" Background="DimGray">
+ AllowDrop="true" Background="DimGrey">
<VerticalStack Margin="50">
- <Label Name="txt" Text="Drop here" Foreground="Gray"/>
- <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Gray"/>
+ <Label Name="txt" Text="Drop here" Foreground="Grey"/>
+ <Label Text="Dragged" Visible="{../../IsDragged}" Foreground="Grey"/>
</VerticalStack>
</Container>
</HorizontalStack>
\ No newline at end of file
<DockWindow Left="450" Top="450" Width="150" Height="150" Background="Maize"/>-->
-<!--<Group Background="DimGray" Margin = "0" Focusable="true" >
- <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window>
- <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window>
- <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window>
- <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window>
+<!--<Group Background="DimGrey" Margin = "0" Focusable="true" >
+ <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Grey}" MouseLeave="{Background=Green}"/></Window>
+ <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></Window>
+ <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></Window>
+ <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></Window>
</Group>-->
<!--<Docker >
<DockWindow Resizable = "true" Top="100" Left="100" Caption="View 1" Width="300" Height="300">
<Label Text="{../../LogicalParent}" Background="Black"/>
</VerticalStack>
</DockWindow>
- <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow>
- <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow>
- <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow>
+ <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></DockWindow>
+ <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></DockWindow>
+ <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></DockWindow>
</Docker>-->
\ No newline at end of file
<DockWindow Left="400" Top="400" Width="150" Height="150" Background="DarkYellow"/>
<DockWindow Left="500" Top="500" Width="150" Height="150" Background="Yellow"/>
</Docker>
-<!--<Group Background="DimGray" Margin = "0" Focusable="true" >
- <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window>
- <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window>
- <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window>
- <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window>
+<!--<Group Background="DimGrey" Margin = "0" Focusable="true" >
+ <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Grey}" MouseLeave="{Background=Green}"/></Window>
+ <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></Window>
+ <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></Window>
+ <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></Window>
</Group>-->
<!--<Docker >
<DockWindow Resizable = "true" Top="100" Left="100" Caption="View 1" Width="300" Height="300">
<Label Text="{../../LogicalParent}" Background="Black"/>
</VerticalStack>
</DockWindow>
- <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow>
- <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow>
- <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow>
+ <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></DockWindow>
+ <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></DockWindow>
+ <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></DockWindow>
</Docker>-->
\ No newline at end of file
<?xml version="1.0"?>
<Window Width="600" Height="500">
-<VerticalStack Margin="20" Background="DimGray" Spacing="10">
+<VerticalStack Margin="20" Background="DimGrey" Spacing="10">
<GraphicObject Height="100" Width="500" Background="Green"/>
<Splitter/>
<HorizontalStack>
<GraphicObject Height="100" Width="500" Background="Green"/>
</VerticalStack>
</Window>
-<!--<Group Background="DimGray" Margin = "0" Focusable="true" >
- <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window>
- <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window>
- <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window>
- <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window>
+<!--<Group Background="DimGrey" Margin = "0" Focusable="true" >
+ <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Grey}" MouseLeave="{Background=Green}"/></Window>
+ <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></Window>
+ <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></Window>
+ <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></Window>
</Group>-->
<!--<Docker >
<DockWindow Resizable = "true" Top="100" Left="100" Caption="View 1" Width="300" Height="300">
<Label Text="{../../LogicalParent}" Background="Black"/>
</VerticalStack>
</DockWindow>
- <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow>
- <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow>
- <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow>
+ <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Grey}" MouseLeave="{Background=Blue}"/></DockWindow>
+ <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Grey}" MouseLeave="{Background=Yellow}"/></DockWindow>
+ <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Grey}" MouseLeave="{Background=Black}"/></DockWindow>
</Docker>-->
\ No newline at end of file
<?xml version="1.0"?>
-<Group MinimumSize="50,50" Background="DimGray" Margin="10" Width="90%" Height="90%">
+<Group MinimumSize="50,50" Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen"
VerticalAlignment="Top"
MinimumSize="10,10"/>
<?xml version="1.0"?>
-<Group Background="DimGray" Margin="10" Width="90%" Height="90%">
+<Group Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen"
VerticalAlignment="Top"
HorizontalAlignment="Left"
<?xml version="1.0"?>
-<Group Background="DimGray" Margin="10" Fit="true">
+<Group Background="DimGrey" Margin="10" Fit="true">
<GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen"
VerticalAlignment="Top"
HorizontalAlignment="Left"
<?xml version="1.0"?>
-<Group Background="DimGray" Margin="10" Width="70%" Height="50%">
+<Group Background="DimGrey" Margin="10" Width="70%" Height="50%">
<GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen"
VerticalAlignment="Top"
HorizontalAlignment="Left"
<?xml version="1.0"?>
-<Group Background="DimGray" Margin="10" Fit="true">
+<Group Background="DimGrey" Margin="10" Fit="true">
<Label Font="droid bold,40" Text="{fps}" Margin="10" Fit="true"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="SeaGreen"
VerticalAlignment="Top"
</Border>
<Splitter Thickness="3"/>
<Border Width="45%" CornerRadius="10" BorderWidth="1">
- <VerticalStack Width="50%" Height="50%" Background="DimGray">
+ <VerticalStack Width="50%" Height="50%" Background="DimGrey">
<RadioButton IsChecked="false" Caption="Choice 1" Background="hgradient|0:DarkRed|1:Transparent"/>
<RadioButton IsChecked="false" Caption="Choice 2" Background="hgradient|0:DarkRed|1:Transparent"/>
<RadioButton IsChecked="true" Caption="Choice 3" Background="hgradient|0:DarkRed|1:Transparent"/>
<?xml version="1.0"?>
-<VerticalStack MinimumSize="50,50" Background="DimGray" Margin="10" Width="90%" Height="90%">
+<VerticalStack MinimumSize="50,50" Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen"
MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen"
<?xml version="1.0"?>
-<HorizontalStack MinimumSize="50,50" Background="DimGray" Margin="10" Width="90%" Height="90%">
+<HorizontalStack MinimumSize="50,50" Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen"
MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen"
<?xml version="1.0"?>
-<VerticalStack Background="DimGray" Margin="10" Width="90%" Height="90%">
+<VerticalStack Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="20%" Background="SeaGreen"
MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="60%" Background="SeaGreen"
<?xml version="1.0"?>
-<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="90%">
+<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="20%" Background="SeaGreen"
MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="60%" Background="SeaGreen"
<?xml version="1.0"?>
-<VerticalStack Background="DimGray" Margin="10" Width="90%" Height="100%">
+<VerticalStack Background="DimGrey" Margin="10" Width="90%" Height="100%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen"
MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="SeaGreen"
<?xml version="1.0"?>
-<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="100%">
+<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="100%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="SeaGreen"
MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="SeaGreen"
<?xml version="1.0"?>
-<VerticalStack Background="DimGray" Margin="10" Width="90%" Height="90%">
+<VerticalStack Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="SeaGreen"
MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="SeaGreen"
<?xml version="1.0"?>
-<HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="90%">
+<HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="SeaGreen"
MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="SeaGreen"
<?xml version="1.0"?>
<VerticalStack>
- <HorizontalStack Background="DimGray" Margin="10" Width="90%" Height="20%">
+ <HorizontalStack Background="DimGrey" Margin="10" Width="90%" Height="20%">
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
</HorizontalStack>
- <HorizontalStack Background="DimGray" Margin="10" Width="Fit" Height="20%">
+ <HorizontalStack Background="DimGrey" Margin="10" Width="Fit" Height="20%">
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
<Label Font="droid bold, 20" Text="{fps}" Margin="5" Fit="true" Background="SeaGreen"/>
<GenericStack Orientation="Vertical" Spacing="0"
Background="{./Background}"
MouseEnter="{/caption.Foreground=White}"
- MouseLeave="{/caption.Foreground=Gray}">
+ MouseLeave="{/caption.Foreground=Grey}">
<HorizontalStack Left="{./TabOffset}"
Name="TabTitle"
HorizontalAlignment="Left"
Height="{./TabHeight}"
Width="{./TabWidth}">
- <Label Name="caption" Text="{./Caption}" Foreground="Gray" Width="Stretched"/>
+ <Label Name="caption" Text="{./Caption}" Foreground="Grey" Width="Stretched"/>
<Label Text="{./ViewIndex}" Foreground="Green"/>
<Label Text="{./TabOffset}" Foreground="Red"/>
<Border CornerRadius="5" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"
</Border>
</HorizontalStack>
<Container Margin="20">
- <Container Background="DimGray" Name="Content"/>
+ <Container Background="DimGrey" Name="Content"/>
</Container>
</GenericStack>
<?xml version="1.0"?>
-<Expandable Fit="true" Caption="Test expandable" Background="DimGray">
+<Expandable Fit="true" Caption="Test expandable" Background="DimGrey">
<VerticalStack Margin="5" >
<CheckBox Name="chk1" />
<CheckBox Name="chk2" IsChecked="true"/>
-<Expandable Width="Stretched" Background="Gray">
+<Expandable Width="Stretched" Background="Grey">
<Expandable Width="Stretched" Background="LightBlue">
<Expandable Width="Stretched" Background="Green">
<Expandable Width="Stretched" Background="LimeGreen">
- <Expandable Width="Stretched" Background="DimGray">
+ <Expandable Width="Stretched" Background="DimGrey">
<Expandable Width="Stretched" Background="Yellow">
<Expandable Width="Stretched" Background="SeaGreen">
<Expandable Width="Stretched" Background="Blue">
<?xml version="1.0"?>
<VerticalStack Height="Fit" Width="Fit">
<Label Width="Stretched"/>
- <Expandable Width="Fit" Background="Gray">
+ <Expandable Width="Fit" Background="Grey">
<Expandable Background="LightBlue">
<Expandable Background="Green">
<Expandable Background="LimeGreen">
- <Expandable Background="DimGray">
+ <Expandable Background="DimGrey">
<Expandable Width="Stretched" Background="Yellow">
<Expandable Background="SeaGreen">
<Expandable Width="Stretched" Background="Blue">
<?xml version="1.0"?>
-<!--<Container Background="vgradient|0:DarkGray|1:DimGray">-->
+<!--<Container Background="vgradient|0:DarkGrey|1:DimGrey">-->
<GroupBox Fit="true" Background="vgradient|0:SteelBlue|1:Transparent"
Foreground="White">
<!-- <Label/>-->
</VerticalStack>
</Border>
<GraphicObject Height="200"/>
- <Popper Caption="TestPopper" Width="100" Background="DimGray" PopDirection="{alignment}">
+ <Popper Caption="TestPopper" Width="100" Background="DimGrey" PopDirection="{alignment}">
<Border Fit="True" Background="SteelBlue">
<Image Fit="true" Path="#go.Images.Icons.tetra.png" Margin="10"/>
<VerticalStack Fit="true" Margin="10" Background="CornflowerBlue">
<Label Text="Selected Tab:"/>
<Label Text="{../../tabview1.SelectedTab}"/>
</HorizontalStack>
- <TabView Name="tabview1" Background="DimGray" Orientation="Horizontal">
- <TabItem Name="TabItem1" Caption="tab item 1" Background="DimGray">
+ <TabView Name="tabview1" Background="DimGrey" Orientation="Horizontal">
+ <TabItem Name="TabItem1" Caption="tab item 1" Background="DimGrey">
<VerticalStack Margin="20">
<CheckBox/>
<CheckBox/>
<CheckBox/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem2" Caption="tab item 2" Background="DimGray">
+ <TabItem Name="TabItem2" Caption="tab item 2" Background="DimGrey">
<VerticalStack Height="Fit" Margin="10">
<RadioButton Fit="true"/>
<RadioButton/>
<RadioButton/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem3" Background="DimGray" Caption="tab item 3">
+ <TabItem Name="TabItem3" Background="DimGrey" Caption="tab item 3">
<Container Margin="5" CornerRadius="2" >
<TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/>
</Container>
</TabItem>
- <TabItem Name="TabItem4" Background="DimGray" Caption="tab item 4" Margin="0">
+ <TabItem Name="TabItem4" Background="DimGrey" Caption="tab item 4" Margin="0">
<TextBox/>
</TabItem>
</TabView>
- <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
+ <Button Background="vgradient|0:DimGrey|1:Black" HorizontalAlignment="Right"
Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick"/>
</VerticalStack>
</Group>
\ No newline at end of file
<Label Text="Selected Tab:"/>
<Label Text="{../../tabview1.SelectedTab}"/>
</HorizontalStack>
- <TabView Name="tabview1" Background="DimGray" Orientation="Horizontal" Margin="5" >
- <TabItem Name="TabItem1" Caption="tab-1.1" Background="DimGray">
+ <TabView Name="tabview1" Background="DimGrey" Orientation="Horizontal" Margin="5" >
+ <TabItem Name="TabItem1" Caption="tab-1.1" Background="DimGrey">
<VerticalStack Margin="20">
<CheckBox/>
<CheckBox/>
<CheckBox/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem2" Caption="tab-1.2" Background="DimGray">
+ <TabItem Name="TabItem2" Caption="tab-1.2" Background="DimGrey">
<VerticalStack Height="Fit" Margin="10">
<RadioButton Fit="true"/>
<RadioButton/>
<RadioButton/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem3" Background="DimGray" Caption="tab-1.3">
+ <TabItem Name="TabItem3" Background="DimGrey" Caption="tab-1.3">
<Container Margin="5" CornerRadius="2" >
<TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/>
</Container>
</TabItem>
</TabView>
- <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
+ <Button Background="vgradient|0:DimGrey|1:Black" HorizontalAlignment="Right"
Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick"/>
</VerticalStack>
<VerticalStack Width="40%">
<Label Text="Selected Tab:"/>
<Label Text="{../../tabview2.SelectedTab}"/>
</HorizontalStack>
- <TabView Name="tabview2" Background="DimGray" Orientation="Horizontal" >
- <TabItem Name="TabItem1" Caption="tab-2.1" Background="DimGray">
+ <TabView Name="tabview2" Background="DimGrey" Orientation="Horizontal" >
+ <TabItem Name="TabItem1" Caption="tab-2.1" Background="DimGrey">
<VerticalStack Margin="20">
<CheckBox/>
<CheckBox/>
<CheckBox/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem2" Caption="tab-2.2" Background="DimGray">
+ <TabItem Name="TabItem2" Caption="tab-2.2" Background="DimGrey">
<VerticalStack Height="Fit" Margin="10">
<RadioButton Fit="true"/>
<RadioButton/>
<RadioButton/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem3" Background="DimGray" Caption="tab-2.3">
+ <TabItem Name="TabItem3" Background="DimGrey" Caption="tab-2.3">
<Container Margin="5" CornerRadius="2" >
<TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/>
</Container>
</TabItem>
</TabView>
- <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
+ <Button Background="vgradient|0:DimGrey|1:Black" HorizontalAlignment="Right"
Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick2"/>
</VerticalStack>
</HorizontalStack>
<?xml version="1.0"?>
-<VerticalStack Fit="true" Background="vgradient|0:DimGray|1:Black">
+<VerticalStack Fit="true" Background="vgradient|0:DimGrey|1:Black">
<HorizontalStack Fit="True">
<Button Caption="but" MouseClick="onButClick"/>
<Button Caption="but" MouseClick="onButClick" Fit="true"/>
<?xml version="1.0"?>
-<VerticalStack Fit="true" Margin="100" Background="DimGray" >
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+<VerticalStack Fit="true" Margin="100" Background="DimGrey" >
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Grey" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
</VerticalStack>
<?xml version="1.0"?>
-<Container Background="DimGray" Width="300">
+<Container Background="DimGrey" Width="300">
<ComboBox Data="{TestList}" ItemTemplate="#Tests.Interfaces.colorItem.crow"/>
</Container>
\ No newline at end of file
<?xml version="1.0"?>
-<VerticalStack Width="200" Height="Fit" Margin="20" Background="DimGray">
+<VerticalStack Width="200" Height="Fit" Margin="20" Background="DimGrey">
<RadioButton Caption="Radio1"/>
<RadioButton Caption="Radio2" IsChecked="true"/>
<RadioButton Caption="Radio3"/>
<?xml version="1.0"?>
<Group Name="TopContainer" Width="400" Height="400"
- Focusable="True" Background="Gray">
- <ScrollBar Height="Stretched" Orientation="Vertical" Width="16" Maximum="100"/>
+ Focusable="True" Background="Grey">
+ <ScrollBar Height="16" Orientation="Horizontal" Width="Stretched" Maximum="100"/>
</Group>
\ No newline at end of file
<?xml version="1.0"?>
<VerticalStack Name="TopContainer" Width="400" Height="Fit"
- Margin="20" Background="DarkGray">
+ Margin="20" Background="DarkGrey">
<HorizontalStack Fit="true" Margin="5" Background="SkyBlue">
<Spinner Name="sp1" Value="5" ValueChanged="onSpinnerValueChange"/>
<?xml version="1.0"?>
- <VerticalStack Spacing="0" Fit="true" Width="160">
- <HorizontalStack Background="Black">
+ <VerticalStack Spacing="1" Height="Fit" Width="Stretched">
+ <HorizontalStack Background="DarkSlateGrey">
<Label Text="{Name}" Width="Stretched" Font="doid bold, 10" Margin="2"/>
<Button Caption="Reset" MouseClick="onResetClick" Height="Fit"/>
</HorizontalStack>
<Label Text="Maximum:" Style="FpsLabel"/>
<Label Text="{maximum}" Style="FpsDisp"/>
</HorizontalStack>
+ <Border Foreground="White" Width="Stretched" Height="60">
+ <Trend Background="Black" NewValue="{current}" Minimum="0" Maximum="100"/>
+ </Border>
<!-- <HorizontalStack>
<Label Text="Total:" Style="FpsLabel"/>
<Label Text="{total}" Style="FpsDisp"/>
+++ /dev/null
-//
-// Extensions.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2017 jp
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-using System;
-using OpenTK;
-using Crow;
-
-namespace Crow
-{
- public static partial class Extensions {
- public static Vector4 ToVector4(this Color c){
- float[] f = c.floatArray;
- return new Vector4 (f [0], f [1], f [2], f [3]);
- }
- public static Vector3 Transform(this Vector3 v, Matrix4 m){
- return Vector4.Transform(new Vector4(v, 1), m).Xyz;
- }
- public static bool IsInBetween(this int v, int min, int max){
- return v >= min & v <= max;
- }
-
- }
-}
-
+++ /dev/null
-//
-// Shader.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2016 jp
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-
-namespace Crow
-{
- public class Shader : IDisposable
- {
- #region CTOR
- public Shader ()
- {
- Init ();
- }
- public Shader (string vertResPath, string fragResPath = null, string geomResPath = null)
- {
- VertSourcePath = vertResPath;
- FragSourcePath = fragResPath;
- GeomSourcePath = geomResPath;
-
- loadSourcesFiles ();
-
- Init ();
- }
- #endregion
-
- public string VertSourcePath,
- FragSourcePath,
- GeomSourcePath;
- #region Sources
- protected string _vertSource = @"
- #version 300 es
- precision lowp float;
-
- uniform mat4 mvp;
-
- layout(location = 0) in vec3 in_position;
- layout(location = 1) in vec2 in_tex;
-
- out vec2 texCoord;
-
- void main(void)
- {
- texCoord = in_tex;
- gl_Position = mvp * vec4(in_position, 1.0);
- }";
-
- protected string _fragSource = @"
- #version 300 es
- precision lowp float;
-
- uniform sampler2D tex;
-
- in vec2 texCoord;
- out vec4 out_frag_color;
-
- void main(void)
- {
- out_frag_color = texture( tex, texCoord);//vec4(1,0,0,1);
- }";
- string _geomSource = @"";
-// #version 330
-// layout(triangles) in;
-// layout(triangle_strip, max_vertices=3) out;
-// void main()
-// {
-// for(int i=0; i<3; i++)
-// {
-// gl_Position = gl_in[i].gl_Position;
-// EmitVertex();
-// }
-// EndPrimitive();
-// }";
- #endregion
-
- #region Private and protected fields
- public int vsId, fsId, gsId, pgmId, mvpLocation;
-
- Matrix4 mvp = Matrix4.Identity;
- #endregion
-
-
- #region Public properties
- public virtual string vertSource
- {
- get { return _vertSource;}
- set { _vertSource = value; }
- }
- public virtual string fragSource
- {
- get { return _fragSource;}
- set { _fragSource = value; }
- }
- public virtual string geomSource
- {
- get { return _geomSource; }
- set { _geomSource = value; }
- }
-
- public virtual Matrix4 MVP{
- set { mvp = value; }
- get { return mvp; }
- }
- #endregion
-
- #region Public functions
- /// <summary>
- /// configure sources and compile
- /// </summary>
- public virtual void Init()
- {
- Compile ();
- }
- public void Reload(){
- loadSourcesFiles ();
- Compile ();
- }
- public void SetSource(ShaderType shaderType, string _source){
- switch (shaderType) {
- case ShaderType.FragmentShader:
- fragSource = _source;
- return;
- case ShaderType.VertexShader:
- vertSource = _source;
- return;
- case ShaderType.GeometryShader:
- geomSource = _source;
- return;
- }
- }
- public string GetSource(ShaderType shaderType){
- switch (shaderType) {
- case ShaderType.FragmentShader:
- return fragSource;
- case ShaderType.VertexShader:
- return vertSource;
- case ShaderType.GeometryShader:
- return geomSource;
- }
- return "";
- }
- public string GetSourcePath(ShaderType shaderType){
- switch (shaderType) {
- case ShaderType.FragmentShader:
- return FragSourcePath;
- case ShaderType.VertexShader:
- return VertSourcePath;
- case ShaderType.GeometryShader:
- return GeomSourcePath;
- }
- return "";
- }
- public virtual void Compile()
- {
- Dispose ();
-
- pgmId = GL.CreateProgram();
-
- if (!string.IsNullOrEmpty(vertSource))
- {
- vsId = GL.CreateShader(ShaderType.VertexShader);
- compileShader(vsId, vertSource);
- }
- if (!string.IsNullOrEmpty(fragSource))
- {
- fsId = GL.CreateShader(ShaderType.FragmentShader);
- compileShader(fsId, fragSource);
-
- }
- if (!string.IsNullOrEmpty(geomSource))
- {
- gsId = GL.CreateShader(ShaderType.GeometryShader);
- compileShader(gsId,geomSource);
- }
-
- if (vsId != 0)
- GL.AttachShader(pgmId, vsId);
- if (fsId != 0)
- GL.AttachShader(pgmId, fsId);
- if (gsId != 0)
- GL.AttachShader(pgmId, gsId);
-
- BindVertexAttributes ();
-
- string info;
- GL.LinkProgram(pgmId);
- GL.GetProgramInfoLog(pgmId, out info);
-
- if (!string.IsNullOrEmpty (info)) {
- Debug.WriteLine ("Linkage:");
- Debug.WriteLine (info);
- }
-
- info = null;
-
- GL.ValidateProgram(pgmId);
- GL.GetProgramInfoLog(pgmId, out info);
- if (!string.IsNullOrEmpty (info)) {
- Debug.WriteLine ("Validation:");
- Debug.WriteLine (info);
- }
-
- GL.UseProgram (pgmId);
-
- GetUniformLocations ();
- BindSamplesSlots ();
-
- Disable ();
- }
-
- protected virtual void BindVertexAttributes()
- {
- GL.BindAttribLocation(pgmId, 0, "in_position");
- GL.BindAttribLocation(pgmId, 1, "in_tex");
- }
- protected virtual void GetUniformLocations()
- {
- mvpLocation = GL.GetUniformLocation(pgmId, "mvp");
- }
- protected virtual void BindSamplesSlots(){
- GL.Uniform1(GL.GetUniformLocation (pgmId, "tex"), 0);
- }
- public void SetMVP(Matrix4 _mvp){
- GL.UniformMatrix4(mvpLocation, false, ref _mvp);
- }
- public virtual void Enable(){
- GL.UseProgram (pgmId);
- }
- public virtual void Disable(){
- GL.UseProgram (0);
- }
- public static void Enable(Shader s)
- {
- if (s == null)
- return;
- s.Enable ();
- }
- public static void Disable(Shader s)
- {
- if (s == null)
- return;
- s.Disable ();
- }
- #endregion
-
- void loadSourcesFiles(){
- Stream s;
-
- if (!string.IsNullOrEmpty (VertSourcePath)) {
- s = Crow.Interface.StaticGetStreamFromPath (VertSourcePath);
- if (s != null) {
- using (StreamReader sr = new StreamReader (s)) {
- vertSource = sr.ReadToEnd ();
- }
- }
- }
-
- if (!string.IsNullOrEmpty (FragSourcePath)) {
- s = Crow.Interface.StaticGetStreamFromPath (FragSourcePath);
- if (s != null) {
- using (StreamReader sr = new StreamReader (s)) {
- fragSource = sr.ReadToEnd ();
- }
- }
- }
-
- if (!string.IsNullOrEmpty (GeomSourcePath)) {
- s = Crow.Interface.StaticGetStreamFromPath (GeomSourcePath);
- if (s != null) {
- using (StreamReader sr = new StreamReader (s)) {
- geomSource = sr.ReadToEnd ();
- }
- }
- }
- }
- void compileShader(int shader, string source)
- {
- GL.ShaderSource(shader, source);
- GL.CompileShader(shader);
-
- string info;
- GL.GetShaderInfoLog(shader, out info);
- Debug.WriteLine(info);
-
- int compileResult;
- GL.GetShader(shader, ShaderParameter.CompileStatus, out compileResult);
- if (compileResult != 1)
- {
- Debug.WriteLine("Compile Error!");
- Debug.WriteLine(source);
- }
- }
- public override string ToString ()
- {
- return string.Format ("{0} {1} {2}", VertSourcePath, FragSourcePath, GeomSourcePath);
- }
-
- #region IDisposable implementation
- public virtual void Dispose ()
- {
- if (GL.IsProgram (pgmId))
- GL.DeleteProgram (pgmId);
-
- if (GL.IsShader (vsId))
- GL.DeleteShader (vsId);
- if (GL.IsShader (fsId))
- GL.DeleteShader (fsId);
- if (GL.IsShader (gsId))
- GL.DeleteShader (gsId);
- }
- #endregion
- }
-}
-
+++ /dev/null
-//
-// Texture.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2016 jp
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-using System;
-using System.Drawing;
-using OpenTK.Graphics.OpenGL;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Diagnostics;
-
-namespace Crow
-{
- public class Texture
- {
- public string Map;
- public int texRef;
- public int Width;
- public int Height;
-
- public Texture(string _mapPath, bool flipY = true)
- {
- using (Stream s = Interface.StaticGetStreamFromPath (_mapPath)) {
-
- try {
- Map = _mapPath;
-
- Bitmap bitmap = new Bitmap (s);
-
- if (flipY)
- bitmap.RotateFlip (RotateFlipType.RotateNoneFlipY);
-
- BitmapData data = bitmap.LockBits (new System.Drawing.Rectangle (0, 0, bitmap.Width, bitmap.Height),
- ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
-
- createTexture (data.Scan0, data.Width, data.Height);
-
- bitmap.UnlockBits (data);
-
- GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
- GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
-
- GL.GenerateMipmap (GenerateMipmapTarget.Texture2D);
-
- } catch (Exception ex) {
- Debug.WriteLine ("Error loading texture: " + Map + ":" + ex.Message);
- }
- }
- }
-
- public Texture(int width, int height)
- {
- createTexture (IntPtr.Zero, width, height);
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Clamp);
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Clamp);
- }
-
- void createTexture(IntPtr data, int width, int height)
- {
- Width = width;
- Height = height;
-
- GL.GenTextures(1, out texRef);
- GL.BindTexture(TextureTarget.Texture2D, texRef);
- GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, width, height, 0,
- OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data);
- }
-
- public static implicit operator int(Texture t)
- {
- return t == null ? 0: t.texRef;
- }
- }
-
-}
+++ /dev/null
-//
-// vaoMesh.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2016 jp
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-using System;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-
-namespace Crow
-{
- public class vaoMesh : IDisposable
- {
- public int vaoHandle,
- positionVboHandle,
- texVboHandle,
- eboHandle;
-
- public Vector3[] positions;
- public Vector2[] texCoords;
- public int[] indices;
-
- public vaoMesh()
- {
- }
-
- public vaoMesh (Vector3[] _positions, Vector2[] _texCoord, int[] _indices)
- {
- positions = _positions;
- texCoords = _texCoord;
- indices = _indices;
-
- CreateBuffers ();
- }
-
- public vaoMesh (float x, float y, float z, float width, float height, float TileX = 1f, float TileY = 1f)
- {
- positions =
- new Vector3[] {
- new Vector3 (x - width / 2, y + height / 2, z),
- new Vector3 (x - width / 2, y - height / 2, z),
- new Vector3 (x + width / 2, y + height / 2, z),
- new Vector3 (x + width / 2, y - height / 2, z)
- };
- texCoords = new Vector2[] {
- new Vector2 (0, TileY),
- new Vector2 (0, 0),
- new Vector2 (TileX, TileY),
- new Vector2 (TileX, 0)
- };
- indices = new int[] { 0, 1, 2, 3 };
-
- CreateBuffers ();
- }
- public static vaoMesh CreateCube(){
- vaoMesh tmp = new vaoMesh ();
- tmp.positions = new Vector3[]
- {
- new Vector3(-1.0f, -1.0f, -1.0f),
- new Vector3( -1.0f, -1.0f, 1.0f),
- new Vector3( 1.0f, -1.0f, -1.0f),
- new Vector3(1.0f, -1.0f, 1.0f),
- new Vector3(1.0f, 1.0f, -1.0f),
- new Vector3( 1.0f, 1.0f, 1.0f),
- new Vector3( -1.0f, 1.0f, -1.0f),
- new Vector3(-1.0f, 1.0f, 1.0f)
- };
- tmp.indices = new int[]
- {
- // front face
- 0, 2, 1, 1, 2, 3,
- // top face
- 2, 4, 3, 3, 4, 5,
- // back face
- 4, 6, 5, 5, 6, 7,
- // left face
- 6, 0, 7, 7, 0, 1,
- // bottom face
- 1, 3, 7, 7, 3, 5,
- // right face
-// 1, 5, 6, 6, 2, 1,
- };
- tmp.texCoords = new Vector2[]
- {
- new Vector2(0, 0),
- new Vector2(0, 1),
- new Vector2(1, 0),
- new Vector2(1, 1),
- new Vector2(0, 0),
- new Vector2(0, 1),
- new Vector2(1, 0),
- new Vector2(1, 1),
- };
- tmp.CreateBuffers ();
- return tmp;
-// Normals = new Vector3[]
-// {
-// new Vector3(-1.0f, -1.0f, 1.0f),
-// new Vector3( 1.0f, -1.0f, 1.0f),
-// new Vector3( 1.0f, 1.0f, 1.0f),
-// new Vector3(-1.0f, 1.0f, 1.0f),
-// new Vector3(-1.0f, -1.0f, -1.0f),
-// new Vector3( 1.0f, -1.0f, -1.0f),
-// new Vector3( 1.0f, 1.0f, -1.0f),
-// new Vector3(-1.0f, 1.0f, -1.0f),
-// };
-//
-// Colors = new int[]
-// {
-// Utilities.ColorToRgba32(Color.DarkRed),
-// Utilities.ColorToRgba32(Color.DarkRed),
-// Utilities.ColorToRgba32(Color.Gold),
-// Utilities.ColorToRgba32(Color.Gold),
-// Utilities.ColorToRgba32(Color.DarkRed),
-// Utilities.ColorToRgba32(Color.DarkRed),
-// Utilities.ColorToRgba32(Color.Gold),
-// Utilities.ColorToRgba32(Color.Gold),
-// };
- }
- public void CreateBuffers(){
- CreateVBOs ();
- CreateVAOs ();
- }
- protected void CreateVBOs()
- {
- positionVboHandle = GL.GenBuffer();
- GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle);
- GL.BufferData<Vector3>(BufferTarget.ArrayBuffer,
- new IntPtr(positions.Length * Vector3.SizeInBytes),
- positions, BufferUsageHint.StaticDraw);
-
- if (texCoords != null) {
- texVboHandle = GL.GenBuffer ();
- GL.BindBuffer (BufferTarget.ArrayBuffer, texVboHandle);
- GL.BufferData<Vector2> (BufferTarget.ArrayBuffer,
- new IntPtr (texCoords.Length * Vector2.SizeInBytes),
- texCoords, BufferUsageHint.StaticDraw);
- }
-
- GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
-
- if (indices != null) {
- eboHandle = GL.GenBuffer ();
- GL.BindBuffer (BufferTarget.ElementArrayBuffer, eboHandle);
- GL.BufferData (BufferTarget.ElementArrayBuffer,
- new IntPtr (sizeof(uint) * indices.Length),
- indices, BufferUsageHint.StaticDraw);
- GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);
- }
- }
- protected void CreateVAOs()
- {
- vaoHandle = GL.GenVertexArray();
- GL.BindVertexArray(vaoHandle);
-
- GL.EnableVertexAttribArray(0);
- GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle);
- GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, true, Vector3.SizeInBytes, 0);
-
- if (texCoords != null) {
- GL.EnableVertexAttribArray (1);
- GL.BindBuffer (BufferTarget.ArrayBuffer, texVboHandle);
- GL.VertexAttribPointer (1, 2, VertexAttribPointerType.Float, true, Vector2.SizeInBytes, 0);
- }
- if (indices != null)
- GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboHandle);
-
- GL.BindVertexArray(0);
- }
-
- public void Render(BeginMode _primitiveType){
- GL.BindVertexArray(vaoHandle);
- if (indices == null)
- GL.DrawArrays (_primitiveType, 0, positions.Length);
- else
- GL.DrawElements(_primitiveType, indices.Length,
- DrawElementsType.UnsignedInt, IntPtr.Zero);
- GL.BindVertexArray (0);
- }
- public void Render(BeginMode _primitiveType, int[] _customIndices){
- GL.BindVertexArray(vaoHandle);
- GL.DrawElements(_primitiveType, _customIndices.Length,
- DrawElementsType.UnsignedInt, _customIndices);
- GL.BindVertexArray (0);
- }
- public void Render(BeginMode _primitiveType, int instances){
-
- GL.BindVertexArray(vaoHandle);
- GL.DrawElementsInstanced(_primitiveType, indices.Length,
- DrawElementsType.UnsignedInt, IntPtr.Zero, instances);
- GL.BindVertexArray (0);
- }
-
- #region IDisposable implementation
- public void Dispose ()
- {
- GL.DeleteBuffer (positionVboHandle);
- GL.DeleteBuffer (texVboHandle);
- GL.DeleteBuffer (eboHandle);
- GL.DeleteVertexArray (vaoHandle);
- }
- #endregion
-
- }
-}
\ No newline at end of file
// THE SOFTWARE.
using System;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
using Crow;
using System.IO;
using System.Collections.Generic;
namespace Tests
{
- class Showcase : CrowWindow
+ class Showcase : Interface
{
+ public Container crowContainer;
+
[STAThread]
static void Main ()
{
- Showcase win = new Showcase ();
- win.Run (30);
- }
+ using (Showcase app = new Showcase ()) {
+ app.KeyboardKeyDown += App_KeyboardKeyDown;
- public Showcase ()
- : base(1024, 800,"Showcase")
- {
- }
+ GraphicObject g = app.AddWidget ("#Tests.ui.showcase.crow");
+ g.DataSource = app;
+ app.crowContainer = g.FindByName ("CrowContainer") as Container;
+ //I set an empty object as datasource at this level to force update when new
+ //widgets are added to the interface
+ app.crowContainer.DataSource = new object ();
+ app.hideError ();
+
+ while (true)
+ System.Threading.Thread.Sleep (10);
- Container crowContainer;
+ }
+ }
- protected override void OnLoad (EventArgs e)
+ static void App_KeyboardKeyDown (object sender, KeyboardKeyEventArgs e)
{
- base.OnLoad (e);
-
- this.CrowKeyDown += Showcase_CrowKeyDown;
- GraphicObject g = Load ("#Tests.ui.showcase.crow");
- g.DataSource = this;
- crowContainer = g.FindByName ("CrowContainer") as Container;
- //I set an empty object as datasource at this level to force update when new
- //widgets are added to the interface
- crowContainer.DataSource = new object ();
- hideError ();
+
}
- void Showcase_CrowKeyDown (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
+ public Showcase ()
+ : base(1024, 800)
{
- if (e.Key == OpenTK.Input.Key.Escape) {
- Quit (null, null);
- return;
- }
}
+
void Dv_SelectedItemChanged (object sender, SelectionChangeEventArgs e)
{
FileSystemInfo fi = e.NewValue as FileSystemInfo;
if (fi is DirectoryInfo)
return;
hideError();
- lock (this.CurrentInterface.UpdateMutex) {
+ lock (UpdateMutex) {
try {
- GraphicObject g = this.CurrentInterface.Load (fi.FullName);
+ GraphicObject g = Load (fi.FullName);
crowContainer.SetChild (g);
g.DataSource = this;
} catch (InstantiatorException ex) {
hideError();
GraphicObject g = null;
try {
- lock (this.ifaceControl [0].CrowInterface.UpdateMutex) {
+ lock (UpdateMutex) {
Instantiator inst = null;
using (MemoryStream ms = new MemoryStream (Encoding.UTF8.GetBytes (e.Text))){
- inst = new Instantiator (this.ifaceControl [0].CrowInterface, ms);
+ inst = new Instantiator (this, ms);
}
g = inst.CreateInstance ();
crowContainer.SetChild (g);
showError (ex);
}
}
- public override void OnRender (FrameEventArgs e)
- {
- base.OnRender (e);
- }
+
#region Test values for Binding
public int intValue = 500;
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>Tests.BasicTests</StartupObject>
+ <StartupObject>Tests.Showcase</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReleaseVersion>0.5</ReleaseVersion>
<Optimize>false</Optimize>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
<DefineConstants>DEBUG;TRACE;MEASURE_TIME</DefineConstants>
<IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath>
<OutputPath>$(SolutionDir)build\Debug</OutputPath>
+ <EnvironmentVariables>
+ <EnvironmentVariables>
+ <Variable name="MONO_CAIRO_DEBUG_DISPOSE" value="1" />
+ </EnvironmentVariables>
+ </EnvironmentVariables>
+ <ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(RunConfiguration)' == 'Custom Command' ">
+ <StartAction>Program</StartAction>
+ <StartProgram>%24{TargetName}</StartProgram>
+ <StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Drawing" />
- <Reference Include="OpenTK">
- <HintPath>..\packages\OpenTK.2.0.0\lib\net20\OpenTK.dll</HintPath>
- </Reference>
+ <Reference Include="Mono.Posix" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include="BasicTests.cs" />
- <Compile Include="OpenGL\Shader.cs" />
- <Compile Include="OpenGL\vaoMesh.cs" />
- <Compile Include="OpenGL\Texture.cs" />
- <Compile Include="HelloWorld.cs" />
- <Compile Include="CrowWindow.cs" />
- <Compile Include="Hello3D.cs" />
- <Compile Include="OpenGL\Extensions.cs" />
- <Compile Include="InterfaceControler.cs" />
<Compile Include="Showcase.cs" />
<Compile Include="GraphicObjects\ColorCircleSelector.cs" />
<Compile Include="GraphicObjects\SimpleGauge.cs" />
- <Compile Include="Tutorials\T1_HelloWorld.cs" />
- <Compile Include="Tutorials\T3_OpenGLCube.cs" />
- <Compile Include="Tutorials\T4_Gauge.cs" />
- <Compile Include="Tutorials\T2_IML.cs" />
<Compile Include="GraphicObjects\HexaContainer.cs" />
<Compile Include="GraphicObjects\TechBorder.cs" />
+ <Compile Include="testCairoXLib.cs" />
+ <Compile Include="CrowDebugger.cs" />
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="OpenTK.dll.config" />
- <None Include="packages.config" />
<None Include="Interfaces\Divers\testShape.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Folder Include="Interfaces\TemplatedContainer\" />
<Folder Include="Interfaces\TemplatedGroup\" />
<Folder Include="GraphicObjects\" />
- <Folder Include="Tutorials\" />
<Folder Include="Interfaces\DragAndDrop\" />
<Folder Include="Interfaces\Experimental\" />
</ItemGroup>
<EmbeddedResource Include="Interfaces\CheckBox2.imlt" />
<EmbeddedResource Include="Interfaces\perfMsr.crow" />
<EmbeddedResource Include="ui\showcase.crow" />
- <EmbeddedResource Include="Tutorials\test.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </EmbeddedResource>
<EmbeddedResource Include="Interfaces\TabItem.template">
<LogicalName>Crow.TabItem.template</LogicalName>
</EmbeddedResource>
+++ /dev/null
-//
-// HelloWorld.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;
-using Crow;
-
-namespace Tutorials
-{
- class T1_HelloWorld : CrowWindow
- {
- public T1_HelloWorld ()
- : base(800, 600,"Hello World")
- {
- }
-
- protected override void OnLoad (EventArgs e)
- {
- base.OnLoad (e);
- AddWidget (new Label (CurrentInterface) { Text = "Hello World" });
- }
-
- [STAThread]
- static void Main ()
- {
- T1_HelloWorld win = new T1_HelloWorld ();
- win.Run (30);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// HelloWorld.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;
-using Crow;
-
-namespace Tutorials
-{
- class T2_IML : CrowWindow
- {
- public T2_IML ()
- : base(800, 600,"First app with OpenTK")
- {
- }
-
- protected override void OnLoad (EventArgs e)
- {
- base.OnLoad (e);
- Load ("#Tests.Tutorials.test.crow");
- }
-
- [STAThread]
- static void Main ()
- {
- T2_IML win = new T2_IML ();
- win.Run (30);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// HelloCube.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;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using Crow;
-
-namespace Tutorials
-{
- class T3_OpenGLCube : CrowWindow
- {
- [STAThread]
- static void Main ()
- {
- T3_OpenGLCube win = new T3_OpenGLCube ();
- win.Run (30);
- }
-
- public T3_OpenGLCube ()
- : base(800, 600,"Crow Test with OpenTK")
- {
- }
-
- vaoMesh cube;
- Texture texture;
- Matrix4 projection, modelview;
-
- protected override void OnLoad (EventArgs e)
- {
- base.OnLoad (e);
-
- GL.Enable (EnableCap.CullFace);
- GL.Enable (EnableCap.Blend);
- GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
-
- cube = vaoMesh.CreateCube ();
- texture = new Texture ("image/textest.png");
-
- projection =
- Matrix4.CreatePerspectiveFieldOfView (
- MathHelper.PiOver4,
- ClientRectangle.Width / (float)ClientRectangle.Height, 1.0f, 10.0f);
- modelview = Matrix4.LookAt(new Vector3(5,5,5), Vector3.Zero, Vector3.UnitZ);
-
- AddWidget(
- new Window (this.CurrentInterface)
- {
- Caption = "Hello World"
- }
- );
- }
- public override void OnRender (FrameEventArgs e)
- {
- base.OnRender (e);
-
- shader.SetMVP(modelview * projection);
-
- GL.BindTexture (TextureTarget.Texture2D, texture);
- cube.Render (BeginMode.Triangles);
- GL.BindTexture (TextureTarget.Texture2D, 0);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// HelloWorld.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;
-using Crow;
-
-namespace Tutorials
-{
- class T4_Gauge : CrowWindow
- {
- public T4_Gauge ()
- : base(800, 600,"Simple Gauge Tutorial")
- {
- }
-
- protected override void OnLoad (EventArgs e)
- {
- base.OnLoad (e);
- AddWidget (new SimpleGauge (CurrentInterface) {
- Level = 40,
- Width = 30, Height = "50%",
- Foreground = Color.DarkBlue, Background = Color.DimGray
- });
- }
-
- [STAThread]
- static void Main ()
- {
- T4_Gauge win = new T4_Gauge ();
- win.Run (30);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<Window Height="400" Width="50%" Caption="My first Window">
- <Label Text="Hello World"/>
-</Window>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="OpenTK" version="2.0.0" targetFramework="net45" />
-</packages>
\ No newline at end of file
Font = "droid, 10";
Margin = "0";
TextAlignment = "Center";
- Background = "DimGray";
+ Background = "DimGrey";
}
FpsDisp {
Font = "droid bold, 10";
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+using Crow;
+using Mono.Unix.Native;
+using System.Diagnostics;
+using System.Threading;
+
+namespace testsCairoXLib
+{
+ class MainClass
+ {
+ static internal IntPtr xHandle, xwinHnd;
+ static internal Int32 xScreen;
+ static IntPtr xLastEvent;
+ static XLib.XErrorHandler errorHnd;
+
+ static Pollfd[] pollfds;
+
+ static Cairo.Surface surf;
+
+ static void init() {
+ XLib.NativeMethods.XInitThreads ();
+ xHandle = XLib.NativeMethods.XOpenDisplay(IntPtr.Zero);
+ if (xHandle == IntPtr.Zero)
+ throw new NotSupportedException("[XLib] Failed to open display.");
+
+ xScreen = XLib.NativeMethods.XDefaultScreen(xHandle);
+ xLastEvent = Marshal.AllocHGlobal(96);
+
+ int x = 0, y = 0;
+ int width = 800, height = 600;
+
+ xwinHnd = XLib.NativeMethods.XCreateSimpleWindow (xHandle, XLib.NativeMethods.XDefaultRootWindow(xHandle),
+ x, y, (uint)width, (uint)height, 0, IntPtr.Zero, IntPtr.Zero);
+ if (xwinHnd == IntPtr.Zero)
+ throw new NotSupportedException("[XLib] Failed to create window.");
+
+ XLib.NativeMethods.XSelectInput (xHandle, xwinHnd, XLib.EventMask.ExposureMask | XLib.EventMask.KeyPressMask
+ | XLib.EventMask.PointerMotionMask | XLib.EventMask.ButtonPressMask | XLib.EventMask.ButtonReleaseMask);
+
+ XLib.NativeMethods.XMapWindow (xHandle, xwinHnd);
+
+ surf = new Cairo.XlibSurface (xHandle, xwinHnd, XLib.NativeMethods.XDefaultVisual (xHandle, xScreen), (int)width, (int)height);
+
+ pollfds = new Pollfd [1];
+ pollfds [0] = new Pollfd ();
+ pollfds [0].fd = XLib.NativeMethods.XConnectionNumber (xHandle);
+ pollfds [0].events = PollEvents.POLLIN;
+
+ errorHnd = new XLib.XErrorHandler (HandleError);
+ XLib.NativeMethods.XSetErrorHandler (errorHnd);
+ }
+ static int HandleError (IntPtr display, ref XLib.XErrorEvent error_event)
+ {
+ /*if (ErrorExceptions)
+ throw new X11Exception (error_event.display, error_event.resourceid,
+ error_event.serial, error_event.error_code,
+ error_event.request_code, error_event.minor_code);
+ else
+ Console.WriteLine ("X11 Error encountered: {0}{1}\n",
+ X11Exception.GetMessage(error_event.display, error_event.resourceid,
+ error_event.serial, error_event.error_code,
+ error_event.request_code, error_event.minor_code),
+ WhereString());*/
+ Debug.WriteLine ("XERROR {0}", error_event.error_code);
+ return 0;
+ }
+
+ static Stopwatch timer;
+
+ static Point mousePos;
+
+ static void draw() {
+ using (Cairo.Context ctx = new Cairo.Context (surf)) {
+ ctx.SetSourceRGBA (1, 0, 0, 1);
+ ctx.Paint ();
+ ctx.MoveTo (100, 100);
+ ctx.SetSourceRGBA (1, 1, 1, 1);
+ ctx.SetFontSize (20);
+ ctx.ShowText (string.Format("{0,10}",timer.ElapsedMilliseconds.ToString()));
+ ctx.MoveTo (mousePos + new Point(10,0));
+ ctx.Arc (mousePos.X, mousePos.Y, 10, 0, Math.PI * 2.0);
+ ctx.Stroke ();
+ }
+ XLib.NativeMethods.XSync (xHandle, 0);
+ }
+
+ static void interfaceThread()
+ {
+ timer = Stopwatch.StartNew ();
+
+ while (true) {
+ //pollfds [0].fd = XLib.NativeMethods.XConnectionNumber (xHandle);
+ //Syscall.poll (pollfds, 1U, 0);
+
+ draw ();
+
+ if (XLib.NativeMethods.XPending (xHandle) > 0) {
+ XLib.XEvent xevent = new XLib.XEvent ();
+ XLib.NativeMethods.XNextEvent (xHandle, ref xevent);
+
+ switch (xevent.type) {
+ case XLib.XEventName.KeyPress:
+ Debug.WriteLine ("keypress: {0}", xevent.KeyEvent.keycode);
+ break;
+ case XLib.XEventName.MotionNotify:
+ Debug.WriteLine ("motion: ({0},{1})", xevent.MotionEvent.x, xevent.MotionEvent.y);
+ mousePos = new Point(xevent.MotionEvent.x, xevent.MotionEvent.y);
+ break;
+ case XLib.XEventName.ButtonPress:
+ Debug.WriteLine ("button press: {0}", xevent.ButtonEvent.button);
+ break;
+ case XLib.XEventName.ButtonRelease:
+ Debug.WriteLine ("button release: {0}", xevent.ButtonEvent.button);
+ break;
+
+ }
+ }
+ }
+ }
+
+ public static void Main(string[] args)
+ {
+ /*using (Interface app = new Interface ()) {
+ XWindow win = new XWindow (app);
+ win.Show ();
+ app.LoadIMLFragment (@"<SimpleGauge Level='40' Margin='5' Background='Jet' Foreground='Grey' Width='30' Height='50%'/>");
+ app.AddWidget(@"Interfaces/Divers/0.crow");
+ System.Threading.Thread.Sleep (10000);
+ }*/
+
+ init ();
+
+ Thread t = new Thread (interfaceThread);
+ t.IsBackground = true;
+ t.Start ();
+
+ while (true)
+ continue;
+ }
+
+ }
+}
-MouseEnter = "{Background = Gray;Foreground = White;}";
+MouseEnter = "{Background = Grey;Foreground = White;}";
Fit = "true";
-MouseLeave = "{Background=Transparent;Foreground=Gray;}";
+MouseLeave = "{Background=Transparent;Foreground=Grey;}";
MouseDown = "{Background=Red;Foreground=White;}";
-MouseUp = "{Background=Gray;Foreground=White;}";
-Foreground="Gray";
+MouseUp = "{Background=Grey;Foreground=White;}";
+Foreground="Grey";
Margin="5";
CornerRadius="5";
Margin="2";
CornerRadius="0";
TextAlignment="Left";
-Foreground="Gray";
+Foreground="Grey";
MouseEnter = "{Background=SeaGreen;Foreground=White;}";
-MouseLeave = "{Background=Transparent;Foreground=Gray;}";
-MouseDown = "{Background=White;Foreground=DimGray;}";
+MouseLeave = "{Background=Transparent;Foreground=Grey;}";
+MouseDown = "{Background=White;Foreground=DimGrey;}";
MouseUp = "{Background=SeaGreen;Foreground=White;}";
<DirectoryView Name="dv" CurrentDirectory="Interfaces" Width="25%" SelectedItemChanged="Dv_SelectedItemChanged"/>
<Splitter Width="6"/>
<VerticalStack>
- <Container Name="CrowContainer" Height="60%" Background="DimGray"/>
+ <Container Name="CrowContainer" Height="60%" Background="DimGrey"/>
<Splitter/>
<HorizontalStack>
<Scroller Name="scroller1" Background="White"
<?xml version="1.0"?>
<Window Font="droid bold, 10" Caption="Open GL" HorizontalAlignment="Left" Width="30%" Height="90%">
<VerticalStack>
- <HorizontalStack Background="DimGray" Height="Fit" Width="Stretched" Margin="2">
+ <HorizontalStack Background="DimGrey" Height="Fit" Width="Stretched" Margin="2">
<Popper Caption="File" Template="#Tests.ui.Popper.template" Width="Fit">
- <Border Fit="True" Foreground="Gray" Background="DimGray">
+ <Border Fit="True" Foreground="Grey" Background="DimGrey">
<VerticalStack Height="Fit" Width="Fit" Margin="2">
<Label Text="New File" Style="#Tests.ui.MenuItem.style" />
<Label Text="Open..." Style="#Tests.ui.MenuItem.style"/>
gr.LineTo(r.TopRight);
gr.Stroke();
- gr.SetSourceColor(Color.DarkGray);
+ gr.SetSourceColor(Color.DarkGrey);
gr.MoveTo(r.TopRight);
gr.LineTo(r.BottomRight);
gr.LineTo(r.BottomLeft);
gr.Save();
r.Inflate((int)-width / 2, (int)-width / 2);
gr.LineWidth = width;
- gr.SetSourceColor(Color.DarkGray);
+ gr.SetSourceColor(Color.DarkGrey);
gr.MoveTo(r.BottomLeft);
gr.LineTo(r.TopLeft);
gr.LineTo(r.TopRight);
double max = Math.Max (R, Math.Max (G, B)); //Max. value of RGB
double diff = max - min; //Delta RGB value
- if ( diff == 0 )//This is a gray, no chroma...
+ if ( diff == 0 )//This is a grey, no chroma...
return 0;
double h = 0.0, s = diff / max;
public static readonly Color DarkBlue = new Color(0,0,139,"DarkBlue","#00008B");
public static readonly Color DarkCyan = new Color(0,139,139,"DarkCyan","#008B8B");
public static readonly Color DarkGoldenRod = new Color(184,134,11,"DarkGoldenRod","#B8860B");
- public static readonly Color DarkGray = new Color(169,169,169,"DarkGray","#A9A9A9");
public static readonly Color DarkGrey = new Color(169,169,169,"DarkGrey","#A9A9A9");
public static readonly Color DarkGreen = new Color(0,100,0,"DarkGreen","#006400");
public static readonly Color DarkKhaki = new Color(189,183,107,"DarkKhaki","#BDB76B");
public static readonly Color DarkSalmon = new Color(233,150,122,"DarkSalmon","#E9967A");
public static readonly Color DarkSeaGreen = new Color(143,188,143,"DarkSeaGreen","#8FBC8F");
public static readonly Color DarkSlateBlue = new Color(72,61,139,"DarkSlateBlue","#483D8B");
- public static readonly Color DarkSlateGray = new Color(47,79,79,"DarkSlateGray","#2F4F4F");
public static readonly Color DarkSlateGrey = new Color(47,79,79,"DarkSlateGrey","#2F4F4F");
public static readonly Color DarkTurquoise = new Color(0,206,209,"DarkTurquoise","#00CED1");
public static readonly Color DarkViolet = new Color(148,0,211,"DarkViolet","#9400D3");
public static readonly Color DeepPink = new Color(255,20,147,"DeepPink","#FF1493");
public static readonly Color DeepSkyBlue = new Color(0,191,255,"DeepSkyBlue","#00BFFF");
- public static readonly Color DimGray = new Color(105,105,105,"DimGray","#696969");
public static readonly Color DimGrey = new Color(105,105,105,"DimGrey","#696969");
public static readonly Color DodgerBlue = new Color(30,144,255,"DodgerBlue","#1E90FF");
public static readonly Color FireBrick = new Color(178,34,34,"FireBrick","#B22222");
public static readonly Color GhostWhite = new Color(248,248,255,"GhostWhite","#F8F8FF");
public static readonly Color Gold = new Color(255,215,0,"Gold","#FFD700");
public static readonly Color GoldenRod = new Color(218,165,32,"GoldenRod","#DAA520");
- public static readonly Color Gray = new Color(128,128,128,"Gray","#808080");
public static readonly Color Grey = new Color(128,128,128,"Grey","#808080");
public static readonly Color Green = new Color(0,128,0,"Green","#008000");
public static readonly Color GreenYellow = new Color(173,255,47,"GreenYellow","#ADFF2F");
public static readonly Color LightCoral = new Color(240,128,128,"LightCoral","#F08080");
public static readonly Color LightCyan = new Color(224,255,255,"LightCyan","#E0FFFF");
public static readonly Color LightGoldenRodYellow = new Color(250,250,210,"LightGoldenRodYellow","#FAFAD2");
- public static readonly Color LightGray = new Color(211,211,211,"LightGray","#D3D3D3");
public static readonly Color LightGrey = new Color(211,211,211,"LightGrey","#D3D3D3");
public static readonly Color LightGreen = new Color(144,238,144,"LightGreen","#90EE90");
public static readonly Color LightPink = new Color(255,182,193,"LightPink","#FFB6C1");
public static readonly Color LightSalmon = new Color(255,160,122,"LightSalmon","#FFA07A");
public static readonly Color LightSeaGreen = new Color(32,178,170,"LightSeaGreen","#20B2AA");
public static readonly Color LightSkyBlue = new Color(135,206,250,"LightSkyBlue","#87CEFA");
- public static readonly Color LightSlateGray = new Color(119,136,153,"LightSlateGray","#778899");
public static readonly Color LightSlateGrey = new Color(119,136,153,"LightSlateGrey","#778899");
public static readonly Color LightSteelBlue = new Color(176,196,222,"LightSteelBlue","#B0C4DE");
public static readonly Color LightYellow = new Color(255,255,224,"LightYellow","#FFFFE0");
public static readonly Color Silver = new Color(192,192,192,"Silver","#C0C0C0");
public static readonly Color SkyBlue = new Color(135,206,235,"SkyBlue","#87CEEB");
public static readonly Color SlateBlue = new Color(106,90,205,"SlateBlue","#6A5ACD");
- public static readonly Color SlateGray = new Color(112,128,144,"SlateGray","#708090");
public static readonly Color SlateGrey = new Color(112,128,144,"SlateGrey","#708090");
public static readonly Color Snow = new Color(255,250,250,"Snow","#FFFAFA");
public static readonly Color SpringGreen = new Color(0,255,127,"SpringGreen","#00FF7F");
#region private fields
int _borderWidth;
BorderStyle _borderStyle;
- Fill raisedColor = Color.Gray;
- Fill sunkenColor = Color.DimGray;
+ Fill raisedColor = Color.Grey;
+ Fill sunkenColor = Color.DimGrey;
#endregion
#region public properties
(Parent as GraphicObject).ChildrenLayoutingConstraints (ref layoutType);
// //prevent queueing same LayoutingType for this
-// layoutType &= (~RegisteredLayoutings);
+ layoutType &= (~RegisteredLayoutings);
if (layoutType == LayoutingType.None)
return;
Debug.WriteLine (string.Format("RecreateCache -> {0}", this.ToString ()));
#endif
IsDirty = false;
- if (bmp != null)
- bmp.Dispose ();
- bmp = new ImageSurface (Format.Argb32, Slot.Width, Slot.Height);
+ bmp?.Dispose ();
+ bmp = IFace.surf.CreateSimilar(Content.ColorAlpha, Slot.Width, Slot.Height);
using (Context gr = new Context (bmp)) {
gr.Antialias = Interface.Antialias;
onDraw (gr);
#region Keyboard handling
public virtual void onKeyDown(object sender, KeyboardKeyEventArgs e){
- KeyDown.Raise (sender, e);
+ KeyDown.Raise (this, e);
}
public virtual void onKeyUp(object sender, KeyboardKeyEventArgs e){
- KeyUp.Raise (sender, e);
+ KeyUp.Raise (this, e);
}
public virtual void onKeyPress(object sender, KeyPressEventArgs e){
- KeyPress.Raise (sender, e);
+ KeyPress.Raise (this, e);
}
#endregion
/// <returns>return true, if point is in the bounds of this control</returns>
/// <param name="m">by ref point to test, init value is not kept</param>
public virtual bool PointIsIn(ref Point m)
- {
+ {
+ if (parent == null)
+ return false;
if (!(Visible & isEnabled)||IsDragged)
return false;
if (!parent.PointIsIn(ref m))
return;
_orientation = value;
NotifyValueChanged ("Orientation", _orientation);
+ if (_orientation == Orientation.Horizontal)
+ NotifyValueChanged ("ScrollBackShape", "M 0.5,5.5 L 10.5, 0.5 L 10.5,0.5 Z");
+ else
+ NotifyValueChanged ("ScrollBackShape", "M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z");
RegisterForGraphicUpdate ();
}
}
protected double unity;
#region Public properties
- [DefaultValue("vgradient|0:White|0,1:LightGray|0,9:LightGray|1:DimGray")]
+ [DefaultValue("vgradient|0:White|0,1:LightGrey|0,9:LightGrey|1:DimGrey")]
public virtual Fill CursorColor {
get { return _cursorColor; }
set {
protected override void onDraw (Context gr)
{
base.onDraw (gr);
+
if (Maximum <= 0)
return;
pEnd.X += 0.5;
}
+
+ Background.SetAsSource (gr,r);
+ gr.Rectangle (r);
+ gr.Fill ();
DrawGraduations (gr, pStart,pEnd);
cursor.TopLeft = new Point ((int)(p1.X - r.Width / 2),
r.Top + (int)((Value - Minimum) * unity));
}
- cursor.Inflate (-1);
+ //cursor.Inflate (-1);
}
Point mouseDownInit;
double mouseDownInitValue;
{
base.onMouseMove (sender, e);
- if (!IsActive)
+ if (!IsActive || go1 == null || go2 == null)
return;
GenericStack gs = Parent as GenericStack;
AddValue (value);
}
}
- [XmlAttributeAttribute()][DefaultValue(100)]
+ [XmlAttributeAttribute()][DefaultValue(400)]
public virtual int NbValues {
get { return nbValues; }
set {
RegisterForRedraw ();
}
}
- [XmlAttributeAttribute()][DefaultValue(20.0)]
+ [XmlAttributeAttribute()][DefaultValue(1.0)]
public virtual double LowThreshold {
get { return lowThreshold; }
set {
using Cairo;
using System.Globalization;
using Crow.IML;
+using System.Runtime.InteropServices;
+
+
namespace Crow
{
/// The resulting surface (a byte array in the OpenTK renderer) is made available and protected with the
/// RenderMutex of the interface.
/// </remarks>
- public class Interface : ILayoutable
+ public class Interface : ILayoutable, IDisposable ,IValueChange
{
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ internal IntPtr xHandle, xwinHnd, xDefaultRootWin, xDefaultVisual;
+ internal UInt32 xDefaultDepth;
+ internal Int32 xScreen;
+ XLib.XErrorHandler errorHnd;
+
#region CTOR
static Interface(){
if (Type.GetType ("Mono.Runtime") == null) {
FontRenderingOptions.HintStyle = HintStyle.Full;
FontRenderingOptions.SubpixelOrder = SubpixelOrder.Rgb;
}
- public Interface(){
- CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
+ public Interface(int width=800, int height=600){
+
+ clientRectangle = new Rectangle (0, 0, width, height);
+
+ Init ();
+
+ initX ();
+ }
+ private int HandleError (IntPtr display, ref XLib.XErrorEvent error_event)
+ {
+ /*if (ErrorExceptions)
+ throw new X11Exception (error_event.display, error_event.resourceid,
+ error_event.serial, error_event.error_code,
+ error_event.request_code, error_event.minor_code);
+ else
+ Console.WriteLine ("X11 Error encountered: {0}{1}\n",
+ X11Exception.GetMessage(error_event.display, error_event.resourceid,
+ error_event.serial, error_event.error_code,
+ error_event.request_code, error_event.minor_code),
+ WhereString());*/
+ Debug.WriteLine ("XERROR {0}", error_event.error_code);
+ return 0;
+ }
+ #endregion
+
+ void interfaceThread()
+ {
+ while (true) {
+ Update ();
+
+ if (XLib.NativeMethods.XPending (xHandle) > 0) {
+ XLib.XEvent xevent = new XLib.XEvent ();
+ XLib.NativeMethods.XNextEvent (xHandle, ref xevent);
+
+ switch (xevent.type) {
+ case XLib.XEventName.Expose:
+ ProcessResize (new Rectangle (0, 0, xevent.ExposeEvent.width, xevent.ExposeEvent.height));
+ break;
+ case XLib.XEventName.KeyPress:
+ ProcessKeyDown (xevent.KeyEvent.keycode);
+ //Debug.WriteLine ("keypress: {0}", xevent.KeyEvent.keycode);
+ break;
+ case XLib.XEventName.KeyRelease:
+ ProcessKeyUp (xevent.KeyEvent.keycode);
+ //Debug.WriteLine ("keypress: {0}", xevent.KeyEvent.keycode);
+ break;
+ case XLib.XEventName.MotionNotify:
+ //Debug.WriteLine ("motion: ({0},{1})", xevent.MotionEvent.x, xevent.MotionEvent.y);
+ ProcessMouseMove (xevent.MotionEvent.x, xevent.MotionEvent.y);
+ break;
+ case XLib.XEventName.ButtonPress:
+ //Debug.WriteLine ("button press: {0}", xevent.ButtonEvent.button);
+ if (xevent.ButtonEvent.button == 4)
+ ProcessMouseWheelChanged (WheelIncrement);
+ else if(xevent.ButtonEvent.button == 5)
+ ProcessMouseWheelChanged (-WheelIncrement);
+ else
+ ProcessMouseButtonDown (xevent.ButtonEvent.button - 1);
+ break;
+ case XLib.XEventName.ButtonRelease:
+ //Debug.WriteLine ("button release: {0}", xevent.ButtonEvent.button);
+ ProcessMouseButtonUp (xevent.ButtonEvent.button - 1);
+ break;
+
+ }
+ }
+ }
+ }
+
+ #region IDisposable Support
+ private bool disposedValue = false; // To detect redundant calls
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!disposedValue)
+ {
+ if (disposing)
+ {
+ // TODO: dispose managed state (managed objects).
+ }
+
+ //Marshal.FreeHGlobal (lastEvent);
+ XLib.NativeMethods.XCloseDisplay (xHandle);
+
+ disposedValue = true;
+ }
+ }
+
+ // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources.
+ ~Interface() {
+ // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
+ Dispose(false);
+ }
+
+ // This code added to correctly implement the disposable pattern.
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
}
#endregion
public void Init () {
+ CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
CurrentInterface = this;
- loadCursors ();
+ //loadCursors ();
loadStyling ();
findAvailableTemplates ();
- initTooltip ();
- initContextMenus ();
+ //initTooltip ();
+ //initContextMenus ();
+
+ #if MEASURE_TIME
+ PerfMeasures.Add (updateMeasure);
+ PerfMeasures.Add (drawingMeasure);
+ PerfMeasures.Add (layoutingMeasure);
+ PerfMeasures.Add (clippingMeasure);
+ #endif
+ }
+
+ protected virtual void initX() {
+ XLib.NativeMethods.XInitThreads ();
+ xHandle = XLib.NativeMethods.XOpenDisplay(IntPtr.Zero);
+ if (xHandle == IntPtr.Zero)
+ throw new NotSupportedException("[XLib] Failed to open display.");
+
+ xScreen = XLib.NativeMethods.XDefaultScreen(xHandle);
+
+ xDefaultRootWin = XLib.NativeMethods.XDefaultRootWindow (xHandle);
+ xDefaultVisual = XLib.NativeMethods.XDefaultVisual (xHandle, xScreen);
+ xDefaultDepth = XLib.NativeMethods.XDefaultDepth (xHandle, xScreen);
+
+ xwinHnd = XLib.NativeMethods.XCreateSimpleWindow (xHandle, xDefaultRootWin,
+ 0, 0, (uint)clientRectangle.Width, (uint)clientRectangle.Height, 0, IntPtr.Zero, IntPtr.Zero);
+ if (xwinHnd == IntPtr.Zero)
+ throw new NotSupportedException("[XLib] Failed to create window.");
+
+ XLib.NativeMethods.XSelectInput (xHandle, xwinHnd, XLib.EventMask.ExposureMask |
+ XLib.EventMask.KeyPressMask | XLib.EventMask.KeyReleaseMask |
+ XLib.EventMask.PointerMotionMask | XLib.EventMask.ButtonPressMask | XLib.EventMask.ButtonReleaseMask);
+
+ XLib.NativeMethods.XMapWindow (xHandle, xwinHnd);
+
+ surf = new Cairo.XlibSurface (xHandle, xwinHnd, xDefaultVisual, clientRectangle.Width, clientRectangle.Height);
+
+ errorHnd = new XLib.XErrorHandler (HandleError);
+ XLib.NativeMethods.XSetErrorHandler (errorHnd);
+
+ Thread t = new Thread (interfaceThread);
+ t.IsBackground = true;
+ t.Start ();
+
}
#region Static and constants
public static int DeviceRepeatDelay = 700;
/// <summary> Time interval in millisecond between device event repeat</summary>
public static int DeviceRepeatInterval = 40;
+ public static float WheelIncrement = 1;
/// <summary>Tabulation size in Text controls</summary>
public static int TabSize = 4;
public static string LineBreak = "\n";
public event EventHandler<KeyboardKeyEventArgs> KeyboardKeyUp;
#endregion
+ /// <summary>Main Cairo surface</summary>
+ public Surface surf;
+
#region Public Fields
/// <summary>Graphic Tree of this interface</summary>
public List<GraphicObject> GraphicTree = new List<GraphicObject>();
#region Private Fields
/// <summary>Client rectangle in the host context</summary>
- Rectangle clientRectangle;
+ protected Rectangle clientRectangle;
/// <summary>Clipping rectangles on the root context</summary>
Region clipping = new Region();
/// <summary>Main Cairo context</summary>
Context ctx;
- /// <summary>Main Cairo surface</summary>
- Surface surf;
#endregion
#region Default values and Style loading
if (path.StartsWith ("#")) {
string resId = path.Substring (1);
//try/catch added to prevent nunit error
- try {
+ try {
stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId);
} catch{}
if (stream == null)//try to find ressource in Crow assembly
#endif
if (DragImage != null)
clipping.UnionRectangle(new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight));
- using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) {
- using (ctx = new Context (surf)){
- if (!clipping.IsEmpty) {
-
- for (int i = 0; i < clipping.NumRectangles; i++)
- ctx.Rectangle(clipping.GetRectangle(i));
-
- ctx.ClipPreserve();
- ctx.Operator = Operator.Clear;
- ctx.Fill();
- ctx.Operator = Operator.Over;
-
- for (int i = GraphicTree.Count -1; i >= 0 ; i--){
- GraphicObject p = GraphicTree[i];
- if (!p.Visible)
- continue;
- if (clipping.Contains (p.Slot) == RegionOverlap.Out)
- continue;
+ //using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) {
+ using (ctx = new Context (surf)){
+ if (!clipping.IsEmpty) {
+ IsDirty = true;
+ for (int i = 0; i < clipping.NumRectangles; i++)
+ ctx.Rectangle(clipping.GetRectangle(i));
+
+ ctx.ClipPreserve();
+ ctx.Operator = Operator.Clear;
+ ctx.Fill();
+ ctx.Operator = Operator.Over;
+
+ for (int i = GraphicTree.Count -1; i >= 0 ; i--){
+ GraphicObject p = GraphicTree[i];
+ if (!p.Visible)
+ continue;
+ if (clipping.Contains (p.Slot) == RegionOverlap.Out)
+ continue;
+
+ ctx.Save ();
+ p.Paint (ref ctx);
+ ctx.Restore ();
+ }
+
+ if (DragAndDropOperation != null) {
+ if (DragImage != null) {
+ DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight);
+ DragImageX = Mouse.X - DragImageWidth / 2;
+ DragImageY = Mouse.Y - DragImageHeight / 2;
ctx.Save ();
- p.Paint (ref ctx);
+ ctx.ResetClip ();
+ ctx.SetSourceSurface (DragImage, DragImageX, DragImageY);
+ ctx.PaintWithAlpha (0.8);
ctx.Restore ();
- }
-
- if (DragAndDropOperation != null) {
- if (DragImage != null) {
- DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight);
- DragImageX = Mouse.X - DragImageWidth / 2;
- DragImageY = Mouse.Y - DragImageHeight / 2;
- ctx.Save ();
- ctx.ResetClip ();
- ctx.SetSourceSurface (DragImage, DragImageX, DragImageY);
- ctx.PaintWithAlpha (0.8);
- ctx.Restore ();
- DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight);
- IsDirty = true;
- //Console.WriteLine ("dragimage drawn: {0},{1}", DragImageX, DragImageY);
- }
- }
-
- #if DEBUG_CLIP_RECTANGLE
- clipping.stroke (ctx, Color.Red.AdjustAlpha(0.5));
- #endif
- lock (RenderMutex) {
-// Array.Copy (bmp, dirtyBmp, bmp.Length);
-
- if (IsDirty)
- DirtyRect += clipping.Extents;
- else
- DirtyRect = clipping.Extents;
+ DirtyRect += new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight);
IsDirty = true;
-
- DirtyRect.Left = Math.Max (0, DirtyRect.Left);
- DirtyRect.Top = Math.Max (0, DirtyRect.Top);
- DirtyRect.Width = Math.Min (ClientRectangle.Width - DirtyRect.Left, DirtyRect.Width);
- DirtyRect.Height = Math.Min (ClientRectangle.Height - DirtyRect.Top, DirtyRect.Height);
- DirtyRect.Width = Math.Max (0, DirtyRect.Width);
- DirtyRect.Height = Math.Max (0, DirtyRect.Height);
-
- if (DirtyRect.Width > 0 && DirtyRect.Height >0) {
- dirtyBmp = new byte[4 * DirtyRect.Width * DirtyRect.Height];
- for (int y = 0; y < DirtyRect.Height; y++) {
- Array.Copy (bmp,
- ((DirtyRect.Top + y) * ClientRectangle.Width * 4) + DirtyRect.Left * 4,
- dirtyBmp, y * DirtyRect.Width * 4, DirtyRect.Width * 4);
- }
-
- } else
- IsDirty = false;
+ //Console.WriteLine ("dragimage drawn: {0},{1}", DragImageX, DragImageY);
}
- clipping.Dispose ();
- clipping = new Region ();
}
+
+ #if DEBUG_CLIP_RECTANGLE
+ clipping.stroke (ctx, Color.Red.AdjustAlpha(0.5));
+ #endif
+
+ clipping.Dispose ();
+ clipping = new Region ();
+ //}
//surf.WriteToPng (@"/mnt/data/test.png");
+
+ //XLib.NativeMethods.XSync (xHandle, 0);
}
}
#if MEASURE_TIME
#region GraphicTree handling
/// <summary>Add widget to the Graphic tree of this interface and register it for layouting</summary>
- public void AddWidget(GraphicObject g)
+ public GraphicObject AddWidget(GraphicObject g)
{
g.Parent = this;
int ptr = 0;
g.RegisteredLayoutings = LayoutingType.None;
g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
+
+ return g;
}
/// <summary>Set visible state of widget to false and delete if from the graphic tree</summary>
public void DeleteWidget(GraphicObject g)
/// when window resize event occurs.
/// </summary>
/// <param name="bounds">bounding box of the interface</param>
- public void ProcessResize(Rectangle bounds){
+ public virtual void ProcessResize(Rectangle bounds){
lock (UpdateMutex) {
clientRectangle = bounds;
- int stride = 4 * ClientRectangle.Width;
- int bmpSize = Math.Abs (stride) * ClientRectangle.Height;
- bmp = new byte[bmpSize];
- dirtyBmp = new byte[bmpSize];
+
+ /*surf.Dispose ();
+ surf = new Cairo.XlibSurface (xHandle, xwinHnd, xDefaultVisual, clientRectangle.Width, clientRectangle.Height);*/
+ (surf as XlibSurface).SetSize (clientRectangle.Width, clientRectangle.Height);
+
foreach (GraphicObject g in GraphicTree)
g.RegisterForLayouting (LayoutingType.All);
lastKeyDownEvt.IsRepeat = true;
_focusedWidget.onKeyDown (this, e);
+ KeyboardKeyDown.Raise (this, e);
// keyboardRepeatThread = new Thread (keyboardRepeatThreadFunc);
// keyboardRepeatThread.IsBackground = true;
// keyboardRepeatThread.Start ();
_focusedWidget.onKeyUp (this, e);
+ KeyboardKeyUp.Raise (this, e);
+
// if (keyboardRepeatThread != null) {
// keyboardRepeatOn = false;
// keyboardRepeatThread.Abort();
#endregion
#if MEASURE_TIME
- public PerformanceMeasure clippingMeasure = new PerformanceMeasure("Clipping", 100);
- public PerformanceMeasure layoutingMeasure = new PerformanceMeasure("Layouting", 100);
- public PerformanceMeasure updateMeasure = new PerformanceMeasure("Update", 100);
- public PerformanceMeasure drawingMeasure = new PerformanceMeasure("Drawing", 100);
+ public PerformanceMeasure clippingMeasure = new PerformanceMeasure("Clipping", 1);
+ public PerformanceMeasure layoutingMeasure = new PerformanceMeasure("Layouting", 1);
+ public PerformanceMeasure updateMeasure = new PerformanceMeasure("Update", 1);
+ public PerformanceMeasure drawingMeasure = new PerformanceMeasure("Drawing", 1);
+ public List<PerformanceMeasure> PerfMeasures = new List<PerformanceMeasure>();
#endif
#if DEBUG_LAYOUTING
public List<LQIList> LQIsTries = new List<LQIList>();
{
Default,
None,
- Gray,
+ Grey,
Subpixel,
}
}
}
}
}
-
-// public override int Read ()
-// {
-// int tmp = base.Read ();
-// char c = (char)tmp;
-// if (c == '\n') {
-// line++;
-// column = 1;
-// } else if (c == '\t')
-// column += Interface.TabSize;
-// else if (c != '\r')
-// column++;
-// return tmp;
-// }
}
}
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+
+namespace XLib
+{
+ public class Display : IDisposable
+ {
+ internal IntPtr handle;
+ internal Int32 screen;
+ IntPtr lastEvent;
+
+ public Display()
+ {
+ handle = NativeMethods.XOpenDisplay(IntPtr.Zero);
+ if (handle == IntPtr.Zero)
+ throw new NotSupportedException("[XLib] Failed to open display.");
+
+ screen = NativeMethods.XDefaultScreen(handle);
+ lastEvent = Marshal.AllocHGlobal(96);
+ }
+
+ /*public IntPtr NextEvent {
+ get {
+ NativeMethods.XNextEvent(handle, lastEvent);
+ return lastEvent;
+ }
+ }*/
+
+ #region IDisposable Support
+ private bool disposedValue = false; // To detect redundant calls
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!disposedValue)
+ {
+ if (disposing)
+ {
+ // TODO: dispose managed state (managed objects).
+ }
+
+ //Marshal.FreeHGlobal (lastEvent);
+ NativeMethods.XCloseDisplay (handle);
+
+ disposedValue = true;
+ }
+ }
+
+ // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources.
+ ~Display() {
+ // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
+ Dispose(false);
+ }
+
+ // This code added to correctly implement the disposable pattern.
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+ #endregion
+
+
+ }
+}
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+
+namespace XLib
+{
+ public static class NativeMethods
+ {
+ #region pinvoke
+ [DllImportAttribute("X11")]
+ public static extern int XInitThreads();
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XOpenDisplay(IntPtr displayName);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XCloseDisplay(IntPtr disp);
+ [DllImportAttribute("X11")]
+ public static extern Int32 XDefaultScreen(IntPtr disp);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XDefaultRootWindow(IntPtr disp);
+ [DllImportAttribute("X11")]
+ public static extern UInt32 XDefaultDepth (IntPtr disp, Int32 screen);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XDefaultVisual(IntPtr disp, Int32 screen);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XCreateSimpleWindow(IntPtr disp, IntPtr rootWindow, Int32 x, Int32 y, UInt32 width, UInt32 height,
+ UInt32 borderWidth, IntPtr border, IntPtr background);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XCreatePixmap(IntPtr disp, IntPtr rootWindow, UInt32 width, UInt32 height, UInt32 depth);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XFreePixmap(IntPtr disp, IntPtr pixmap);
+ [DllImportAttribute("X11")]
+ public static extern Int32 XSelectInput(IntPtr disp, IntPtr win, EventMask eventMask);
+ [DllImportAttribute("X11")]
+ public static extern Int32 XMapWindow(IntPtr disp, IntPtr win);
+ [DllImportAttribute("X11")]
+ public static extern int XPending (IntPtr disp);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XNextEvent(IntPtr disp, ref XEvent xevent);
+ [DllImportAttribute("X11")]
+ public static extern Int32 XSync(IntPtr disp, int discard);
+ [DllImportAttribute("X11")]
+ public static extern int XConnectionNumber(IntPtr disp);
+ [DllImportAttribute("X11")]
+ public static extern IntPtr XSetErrorHandler(XErrorHandler error_handler);
+ #endregion
+
+
+ }
+}
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+
+namespace XLib
+{
+
+ public enum EventType {
+ KeyPress = 2,
+ KeyRelease,
+ ButtonPress,
+ ButtonRelease,
+ MotionNotify,
+ EnterNotify,
+ LeaveNotify,
+ FocusIn,
+ FocusOut,
+ KeymapNotify,
+ Expose,
+ GraphicsExpose,
+ NoExpose,
+ VisibilityNotify,
+ CreateNotify,
+ DestroyNotify,
+ UnmapNotify,
+ MapNotify,
+ MapRequest,
+ ReparentNotify,
+ ConfigureNotify,
+ ConfigureRequest,
+ GravityNotify,
+ ResizeRequest,
+ CirculateNotify,
+ CirculateRequest,
+ PropertyNotify,
+ SelectionClear,
+ SelectionRequest,
+ SelectionNotify,
+ ColormapNotify,
+ ClientMessage,
+ MappingNotify,
+ GenericEvent,
+ LASTEvent = 36 /* must be bigger than any event # */
+ }
+ public class Window
+ {
+ IntPtr handle;
+ Display disp;
+
+ public Window (Display display, UInt32 width = 800, UInt32 height = 600, Int32 x = 0, Int32 y = 0) {
+ disp = display;
+ handle = NativeMethods.XCreateSimpleWindow (disp.handle, NativeMethods.XDefaultRootWindow(disp.handle), x, y, width, height,
+ 0, IntPtr.Zero, IntPtr.Zero);
+ if (handle == IntPtr.Zero)
+ throw new NotSupportedException("[XLib] Failed to create window.");
+
+ NativeMethods.XSelectInput (disp.handle, handle, EventMask.ExposureMask | EventMask.KeyPressMask);
+
+ NativeMethods.XMapWindow (disp.handle, handle);
+ }
+
+ }
+}
--- /dev/null
+// 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.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+// Peter Bartok pbartok@novell.com
+//
+
+
+// NOT COMPLETE
+
+using System;
+using System.ComponentModel;
+using System.Collections;
+using System.Drawing;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+/// X11 Version
+namespace XLib {
+ //
+ // In the structures below, fields of type long are mapped to IntPtr.
+ // This will work on all platforms where sizeof(long)==sizeof(void*), which
+ // is almost all platforms except WIN64.
+ //
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XAnyEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XKeyEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr root;
+ public IntPtr subwindow;
+ public IntPtr time;
+ public int x;
+ public int y;
+ public int x_root;
+ public int y_root;
+ public int state;
+ public int keycode;
+ public bool same_screen;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XButtonEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr root;
+ public IntPtr subwindow;
+ public IntPtr time;
+ public int x;
+ public int y;
+ public int x_root;
+ public int y_root;
+ public int state;
+ public int button;
+ public bool same_screen;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XMotionEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr root;
+ public IntPtr subwindow;
+ public IntPtr time;
+ public int x;
+ public int y;
+ public int x_root;
+ public int y_root;
+ public int state;
+ public byte is_hint;
+ public bool same_screen;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XCrossingEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr root;
+ public IntPtr subwindow;
+ public IntPtr time;
+ public int x;
+ public int y;
+ public int x_root;
+ public int y_root;
+ public NotifyMode mode;
+ public NotifyDetail detail;
+ public bool same_screen;
+ public bool focus;
+ public int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XFocusChangeEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public int mode;
+ public NotifyDetail detail;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XKeymapEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public byte key_vector0;
+ public byte key_vector1;
+ public byte key_vector2;
+ public byte key_vector3;
+ public byte key_vector4;
+ public byte key_vector5;
+ public byte key_vector6;
+ public byte key_vector7;
+ public byte key_vector8;
+ public byte key_vector9;
+ public byte key_vector10;
+ public byte key_vector11;
+ public byte key_vector12;
+ public byte key_vector13;
+ public byte key_vector14;
+ public byte key_vector15;
+ public byte key_vector16;
+ public byte key_vector17;
+ public byte key_vector18;
+ public byte key_vector19;
+ public byte key_vector20;
+ public byte key_vector21;
+ public byte key_vector22;
+ public byte key_vector23;
+ public byte key_vector24;
+ public byte key_vector25;
+ public byte key_vector26;
+ public byte key_vector27;
+ public byte key_vector28;
+ public byte key_vector29;
+ public byte key_vector30;
+ public byte key_vector31;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XExposeEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int count;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XGraphicsExposeEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr drawable;
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int count;
+ public int major_code;
+ public int minor_code;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XNoExposeEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr drawable;
+ public int major_code;
+ public int minor_code;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XVisibilityEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XCreateWindowEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr parent;
+ public IntPtr window;
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int border_width;
+ public bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XDestroyWindowEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr xevent;
+ public IntPtr window;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XUnmapEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr xevent;
+ public IntPtr window;
+ public bool from_configure;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XMapEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr xevent;
+ public IntPtr window;
+ public bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XMapRequestEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr parent;
+ public IntPtr window;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XReparentEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr xevent;
+ public IntPtr window;
+ public IntPtr parent;
+ public int x;
+ public int y;
+ public bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XConfigureEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr xevent;
+ public IntPtr window;
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int border_width;
+ public IntPtr above;
+ public bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XGravityEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr xevent;
+ public IntPtr window;
+ public int x;
+ public int y;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XResizeRequestEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public int width;
+ public int height;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XConfigureRequestEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr parent;
+ public IntPtr window;
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int border_width;
+ public IntPtr above;
+ public int detail;
+ public IntPtr value_mask;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XCirculateEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr xevent;
+ public IntPtr window;
+ public int place;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XCirculateRequestEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr parent;
+ public IntPtr window;
+ public int place;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XPropertyEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr atom;
+ public IntPtr time;
+ public int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XSelectionClearEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr selection;
+ public IntPtr time;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XSelectionRequestEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr owner;
+ public IntPtr requestor;
+ public IntPtr selection;
+ public IntPtr target;
+ public IntPtr property;
+ public IntPtr time;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XSelectionEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr requestor;
+ public IntPtr selection;
+ public IntPtr target;
+ public IntPtr property;
+ public IntPtr time;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XColormapEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr colormap;
+ public bool c_new;
+ public int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XClientMessageEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public IntPtr message_type;
+ public int format;
+ public IntPtr ptr1;
+ public IntPtr ptr2;
+ public IntPtr ptr3;
+ public IntPtr ptr4;
+ public IntPtr ptr5;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XMappingEvent {
+ public XEventName type;
+ public IntPtr serial;
+ public bool send_event;
+ public IntPtr display;
+ public IntPtr window;
+ public int request;
+ public int first_keycode;
+ public int count;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XErrorEvent {
+ public XEventName type;
+ public IntPtr display;
+ public IntPtr resourceid;
+ public IntPtr serial;
+ public byte error_code;
+ public XRequest request_code;
+ public byte minor_code;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XEventPad {
+ public IntPtr pad0;
+ public IntPtr pad1;
+ public IntPtr pad2;
+ public IntPtr pad3;
+ public IntPtr pad4;
+ public IntPtr pad5;
+ public IntPtr pad6;
+ public IntPtr pad7;
+ public IntPtr pad8;
+ public IntPtr pad9;
+ public IntPtr pad10;
+ public IntPtr pad11;
+ public IntPtr pad12;
+ public IntPtr pad13;
+ public IntPtr pad14;
+ public IntPtr pad15;
+ public IntPtr pad16;
+ public IntPtr pad17;
+ public IntPtr pad18;
+ public IntPtr pad19;
+ public IntPtr pad20;
+ public IntPtr pad21;
+ public IntPtr pad22;
+ public IntPtr pad23;
+ }
+
+ [StructLayout(LayoutKind.Explicit)]
+ public struct XEvent {
+ [ FieldOffset(0) ] public XEventName type;
+ [ FieldOffset(0) ] public XAnyEvent AnyEvent;
+ [ FieldOffset(0) ] public XKeyEvent KeyEvent;
+ [ FieldOffset(0) ] public XButtonEvent ButtonEvent;
+ [ FieldOffset(0) ] public XMotionEvent MotionEvent;
+ [ FieldOffset(0) ] public XCrossingEvent CrossingEvent;
+ [ FieldOffset(0) ] public XFocusChangeEvent FocusChangeEvent;
+ [ FieldOffset(0) ] public XExposeEvent ExposeEvent;
+ [ FieldOffset(0) ] public XGraphicsExposeEvent GraphicsExposeEvent;
+ [ FieldOffset(0) ] public XNoExposeEvent NoExposeEvent;
+ [ FieldOffset(0) ] public XVisibilityEvent VisibilityEvent;
+ [ FieldOffset(0) ] public XCreateWindowEvent CreateWindowEvent;
+ [ FieldOffset(0) ] public XDestroyWindowEvent DestroyWindowEvent;
+ [ FieldOffset(0) ] public XUnmapEvent UnmapEvent;
+ [ FieldOffset(0) ] public XMapEvent MapEvent;
+ [ FieldOffset(0) ] public XMapRequestEvent MapRequestEvent;
+ [ FieldOffset(0) ] public XReparentEvent ReparentEvent;
+ [ FieldOffset(0) ] public XConfigureEvent ConfigureEvent;
+ [ FieldOffset(0) ] public XGravityEvent GravityEvent;
+ [ FieldOffset(0) ] public XResizeRequestEvent ResizeRequestEvent;
+ [ FieldOffset(0) ] public XConfigureRequestEvent ConfigureRequestEvent;
+ [ FieldOffset(0) ] public XCirculateEvent CirculateEvent;
+ [ FieldOffset(0) ] public XCirculateRequestEvent CirculateRequestEvent;
+ [ FieldOffset(0) ] public XPropertyEvent PropertyEvent;
+ [ FieldOffset(0) ] public XSelectionClearEvent SelectionClearEvent;
+ [ FieldOffset(0) ] public XSelectionRequestEvent SelectionRequestEvent;
+ [ FieldOffset(0) ] public XSelectionEvent SelectionEvent;
+ [ FieldOffset(0) ] public XColormapEvent ColormapEvent;
+ [ FieldOffset(0) ] public XClientMessageEvent ClientMessageEvent;
+ [ FieldOffset(0) ] public XMappingEvent MappingEvent;
+ [ FieldOffset(0) ] public XErrorEvent ErrorEvent;
+ [ FieldOffset(0) ] public XKeymapEvent KeymapEvent;
+
+ //[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=24)]
+ //[ FieldOffset(0) ] public int[] pad;
+ [ FieldOffset(0) ] public XEventPad Pad;
+ public override string ToString() {
+ switch (type)
+ {
+ case XEventName.ButtonPress:
+ case XEventName.ButtonRelease:
+ return ToString (ButtonEvent);
+ case XEventName.CirculateNotify:
+ case XEventName.CirculateRequest:
+ return ToString (CirculateEvent);
+ case XEventName.ClientMessage:
+ return ToString (ClientMessageEvent);
+ case XEventName.ColormapNotify:
+ return ToString (ColormapEvent);
+ case XEventName.ConfigureNotify:
+ return ToString (ConfigureEvent);
+ case XEventName.ConfigureRequest:
+ return ToString (ConfigureRequestEvent);
+ case XEventName.CreateNotify:
+ return ToString (CreateWindowEvent);
+ case XEventName.DestroyNotify:
+ return ToString (DestroyWindowEvent);
+ case XEventName.Expose:
+ return ToString (ExposeEvent);
+ case XEventName.FocusIn:
+ case XEventName.FocusOut:
+ return ToString (FocusChangeEvent);
+ case XEventName.GraphicsExpose:
+ return ToString (GraphicsExposeEvent);
+ case XEventName.GravityNotify:
+ return ToString (GravityEvent);
+ case XEventName.KeymapNotify:
+ return ToString (KeymapEvent);
+ case XEventName.MapNotify:
+ return ToString (MapEvent);
+ case XEventName.MappingNotify:
+ return ToString (MappingEvent);
+ case XEventName.MapRequest:
+ return ToString (MapRequestEvent);
+ case XEventName.MotionNotify:
+ return ToString (MotionEvent);
+ case XEventName.NoExpose:
+ return ToString (NoExposeEvent);
+ case XEventName.PropertyNotify:
+ return ToString (PropertyEvent);
+ case XEventName.ReparentNotify:
+ return ToString (ReparentEvent);
+ case XEventName.ResizeRequest:
+ return ToString (ResizeRequestEvent);
+ case XEventName.SelectionClear:
+ return ToString (SelectionClearEvent);
+ case XEventName.SelectionNotify:
+ return ToString (SelectionEvent);
+ case XEventName.SelectionRequest:
+ return ToString (SelectionRequestEvent);
+ case XEventName.UnmapNotify:
+ return ToString (UnmapEvent);
+ case XEventName.VisibilityNotify:
+ return ToString (VisibilityEvent);
+ case XEventName.EnterNotify:
+ case XEventName.LeaveNotify:
+ return ToString (CrossingEvent);
+ default:
+ return type.ToString ();
+ }
+ }
+
+ public static string ToString (object ev)
+ {
+ string result = string.Empty;
+ Type type = ev.GetType ();
+ System.Reflection.FieldInfo [] fields = type.GetFields (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Instance);
+ for (int i = 0; i < fields.Length; i++) {
+ if (result != string.Empty) {
+ result += ", ";
+ }
+ object value = fields [i].GetValue (ev);
+ result += fields [i].Name + "=" + (value == null ? "<null>" : value.ToString ());
+ }
+ return type.Name + " (" + result + ")";
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XSetWindowAttributes {
+ public IntPtr background_pixmap;
+ public IntPtr background_pixel;
+ public IntPtr border_pixmap;
+ public IntPtr border_pixel;
+ public Gravity bit_gravity;
+ public Gravity win_gravity;
+ public int backing_store;
+ public IntPtr backing_planes;
+ public IntPtr backing_pixel;
+ public bool save_under;
+ public IntPtr event_mask;
+ public IntPtr do_not_propagate_mask;
+ public bool override_redirect;
+ public IntPtr colormap;
+ public IntPtr cursor;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XWindowAttributes {
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int border_width;
+ public int depth;
+ public IntPtr visual;
+ public IntPtr root;
+ public int c_class;
+ public Gravity bit_gravity;
+ public Gravity win_gravity;
+ public int backing_store;
+ public IntPtr backing_planes;
+ public IntPtr backing_pixel;
+ public bool save_under;
+ public IntPtr colormap;
+ public bool map_installed;
+ public MapState map_state;
+ public IntPtr all_event_masks;
+ public IntPtr your_event_mask;
+ public IntPtr do_not_propagate_mask;
+ public bool override_direct;
+ public IntPtr screen;
+
+ public override string ToString ()
+ {
+ return XEvent.ToString (this);
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XTextProperty {
+ public string value;
+ public IntPtr encoding;
+ public int format;
+ public IntPtr nitems;
+ }
+
+ public enum XWindowClass {
+ InputOutput = 1,
+ InputOnly = 2
+ }
+
+ public enum XEventName {
+ KeyPress = 2,
+ KeyRelease = 3,
+ ButtonPress = 4,
+ ButtonRelease = 5,
+ MotionNotify = 6,
+ EnterNotify = 7,
+ LeaveNotify = 8,
+ FocusIn = 9,
+ FocusOut = 10,
+ KeymapNotify = 11,
+ Expose = 12,
+ GraphicsExpose = 13,
+ NoExpose = 14,
+ VisibilityNotify = 15,
+ CreateNotify = 16,
+ DestroyNotify = 17,
+ UnmapNotify = 18,
+ MapNotify = 19,
+ MapRequest = 20,
+ ReparentNotify = 21,
+ ConfigureNotify = 22,
+ ConfigureRequest = 23,
+ GravityNotify = 24,
+ ResizeRequest = 25,
+ CirculateNotify = 26,
+ CirculateRequest = 27,
+ PropertyNotify = 28,
+ SelectionClear = 29,
+ SelectionRequest = 30,
+ SelectionNotify = 31,
+ ColormapNotify = 32,
+ ClientMessage = 33,
+ MappingNotify = 34,
+
+ LASTEvent
+ }
+
+ [Flags]
+ public enum SetWindowValuemask {
+ Nothing = 0,
+ BackPixmap = 1,
+ BackPixel = 2,
+ BorderPixmap = 4,
+ BorderPixel = 8,
+ BitGravity = 16,
+ WinGravity = 32,
+ BackingStore = 64,
+ BackingPlanes = 128,
+ BackingPixel = 256,
+ OverrideRedirect = 512,
+ SaveUnder = 1024,
+ EventMask = 2048,
+ DontPropagate = 4096,
+ ColorMap = 8192,
+ Cursor = 16384
+ }
+
+ public enum SendEventValues {
+ PointerWindow = 0,
+ InputFocus = 1
+ }
+
+ public enum CreateWindowArgs {
+ CopyFromParent = 0,
+ ParentRelative = 1,
+ InputOutput = 1,
+ InputOnly = 2
+ }
+
+ public enum Gravity {
+ ForgetGravity = 0,
+ NorthWestGravity= 1,
+ NorthGravity = 2,
+ NorthEastGravity= 3,
+ WestGravity = 4,
+ CenterGravity = 5,
+ EastGravity = 6,
+ SouthWestGravity= 7,
+ SouthGravity = 8,
+ SouthEastGravity= 9,
+ StaticGravity = 10
+ }
+
+ public enum XKeySym : uint {
+ XK_BackSpace = 0xFF08,
+ XK_Tab = 0xFF09,
+ XK_Clear = 0xFF0B,
+ XK_Return = 0xFF0D,
+ XK_Home = 0xFF50,
+ XK_Left = 0xFF51,
+ XK_Up = 0xFF52,
+ XK_Right = 0xFF53,
+ XK_Down = 0xFF54,
+ XK_Page_Up = 0xFF55,
+ XK_Page_Down = 0xFF56,
+ XK_End = 0xFF57,
+ XK_Begin = 0xFF58,
+ XK_Menu = 0xFF67,
+ XK_Shift_L = 0xFFE1,
+ XK_Shift_R = 0xFFE2,
+ XK_Control_L = 0xFFE3,
+ XK_Control_R = 0xFFE4,
+ XK_Caps_Lock = 0xFFE5,
+ XK_Shift_Lock = 0xFFE6,
+ XK_Meta_L = 0xFFE7,
+ XK_Meta_R = 0xFFE8,
+ XK_Alt_L = 0xFFE9,
+ XK_Alt_R = 0xFFEA,
+ XK_Super_L = 0xFFEB,
+ XK_Super_R = 0xFFEC,
+ XK_Hyper_L = 0xFFED,
+ XK_Hyper_R = 0xFFEE,
+ }
+
+ [Flags]
+ public enum EventMask {
+ NoEventMask = 0,
+ KeyPressMask = 1<<0,
+ KeyReleaseMask = 1<<1,
+ ButtonPressMask = 1<<2,
+ ButtonReleaseMask = 1<<3,
+ EnterWindowMask = 1<<4,
+ LeaveWindowMask = 1<<5,
+ PointerMotionMask = 1<<6,
+ PointerMotionHintMask = 1<<7,
+ Button1MotionMask = 1<<8,
+ Button2MotionMask = 1<<9,
+ Button3MotionMask = 1<<10,
+ Button4MotionMask = 1<<11,
+ Button5MotionMask = 1<<12,
+ ButtonMotionMask = 1<<13,
+ KeymapStateMask = 1<<14,
+ ExposureMask = 1<<15,
+ VisibilityChangeMask = 1<<16,
+ StructureNotifyMask = 1<<17,
+ ResizeRedirectMask = 1<<18,
+ SubstructureNotifyMask = 1<<19,
+ SubstructureRedirectMask= 1<<20,
+ FocusChangeMask = 1<<21,
+ PropertyChangeMask = 1<<22,
+ ColormapChangeMask = 1<<23,
+ OwnerGrabButtonMask = 1<<24
+ }
+
+ public enum GrabMode {
+ GrabModeSync = 0,
+ GrabModeAsync = 1
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XStandardColormap {
+ public IntPtr colormap;
+ public IntPtr red_max;
+ public IntPtr red_mult;
+ public IntPtr green_max;
+ public IntPtr green_mult;
+ public IntPtr blue_max;
+ public IntPtr blue_mult;
+ public IntPtr base_pixel;
+ public IntPtr visualid;
+ public IntPtr killid;
+ }
+
+ [StructLayout(LayoutKind.Sequential, Pack=2)]
+ public struct XColor {
+ public IntPtr pixel;
+ public ushort red;
+ public ushort green;
+ public ushort blue;
+ public byte flags;
+ public byte pad;
+ }
+
+ public enum Atom {
+ AnyPropertyType = 0,
+ XA_PRIMARY = 1,
+ XA_SECONDARY = 2,
+ XA_ARC = 3,
+ XA_ATOM = 4,
+ XA_BITMAP = 5,
+ XA_CARDINAL = 6,
+ XA_COLORMAP = 7,
+ XA_CURSOR = 8,
+ XA_CUT_BUFFER0 = 9,
+ XA_CUT_BUFFER1 = 10,
+ XA_CUT_BUFFER2 = 11,
+ XA_CUT_BUFFER3 = 12,
+ XA_CUT_BUFFER4 = 13,
+ XA_CUT_BUFFER5 = 14,
+ XA_CUT_BUFFER6 = 15,
+ XA_CUT_BUFFER7 = 16,
+ XA_DRAWABLE = 17,
+ XA_FONT = 18,
+ XA_INTEGER = 19,
+ XA_PIXMAP = 20,
+ XA_POINT = 21,
+ XA_RECTANGLE = 22,
+ XA_RESOURCE_MANAGER = 23,
+ XA_RGB_COLOR_MAP = 24,
+ XA_RGB_BEST_MAP = 25,
+ XA_RGB_BLUE_MAP = 26,
+ XA_RGB_DEFAULT_MAP = 27,
+ XA_RGB_GRAY_MAP = 28,
+ XA_RGB_GREEN_MAP = 29,
+ XA_RGB_RED_MAP = 30,
+ XA_STRING = 31,
+ XA_VISUALID = 32,
+ XA_WINDOW = 33,
+ XA_WM_COMMAND = 34,
+ XA_WM_HINTS = 35,
+ XA_WM_CLIENT_MACHINE = 36,
+ XA_WM_ICON_NAME = 37,
+ XA_WM_ICON_SIZE = 38,
+ XA_WM_NAME = 39,
+ XA_WM_NORMAL_HINTS = 40,
+ XA_WM_SIZE_HINTS = 41,
+ XA_WM_ZOOM_HINTS = 42,
+ XA_MIN_SPACE = 43,
+ XA_NORM_SPACE = 44,
+ XA_MAX_SPACE = 45,
+ XA_END_SPACE = 46,
+ XA_SUPERSCRIPT_X = 47,
+ XA_SUPERSCRIPT_Y = 48,
+ XA_SUBSCRIPT_X = 49,
+ XA_SUBSCRIPT_Y = 50,
+ XA_UNDERLINE_POSITION = 51,
+ XA_UNDERLINE_THICKNESS = 52,
+ XA_STRIKEOUT_ASCENT = 53,
+ XA_STRIKEOUT_DESCENT = 54,
+ XA_ITALIC_ANGLE = 55,
+ XA_X_HEIGHT = 56,
+ XA_QUAD_WIDTH = 57,
+ XA_WEIGHT = 58,
+ XA_POINT_SIZE = 59,
+ XA_RESOLUTION = 60,
+ XA_COPYRIGHT = 61,
+ XA_NOTICE = 62,
+ XA_FONT_NAME = 63,
+ XA_FAMILY_NAME = 64,
+ XA_FULL_NAME = 65,
+ XA_CAP_HEIGHT = 66,
+ XA_WM_CLASS = 67,
+ XA_WM_TRANSIENT_FOR = 68,
+
+ XA_LAST_PREDEFINED = 68
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XScreen {
+ public IntPtr ext_data;
+ public IntPtr display;
+ public IntPtr root;
+ public int width;
+ public int height;
+ public int mwidth;
+ public int mheight;
+ public int ndepths;
+ public IntPtr depths;
+ public int root_depth;
+ public IntPtr root_visual;
+ public IntPtr default_gc;
+ public IntPtr cmap;
+ public IntPtr white_pixel;
+ public IntPtr black_pixel;
+ public int max_maps;
+ public int min_maps;
+ public int backing_store;
+ public bool save_unders;
+ public IntPtr root_input_mask;
+ }
+
+ [Flags]
+ public enum ChangeWindowFlags {
+ CWX = 1<<0,
+ CWY = 1<<1,
+ CWWidth = 1<<2,
+ CWHeight = 1<<3,
+ CWBorderWidth = 1<<4,
+ CWSibling = 1<<5,
+ CWStackMode = 1<<6
+ }
+
+ public enum StackMode {
+ Above = 0,
+ Below = 1,
+ TopIf = 2,
+ BottomIf = 3,
+ Opposite = 4
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XWindowChanges {
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int border_width;
+ public IntPtr sibling;
+ public StackMode stack_mode;
+ }
+
+ [Flags]
+ public enum ColorFlags {
+ DoRed = 1<<0,
+ DoGreen = 1<<1,
+ DoBlue = 1<<2
+ }
+
+ public enum NotifyMode {
+ NotifyNormal = 0,
+ NotifyGrab = 1,
+ NotifyUngrab = 2
+ }
+
+ public enum NotifyDetail {
+ NotifyAncestor = 0,
+ NotifyVirtual = 1,
+ NotifyInferior = 2,
+ NotifyNonlinear = 3,
+ NotifyNonlinearVirtual = 4,
+ NotifyPointer = 5,
+ NotifyPointerRoot = 6,
+ NotifyDetailNone = 7
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct MotifWmHints {
+ public IntPtr flags;
+ public IntPtr functions;
+ public IntPtr decorations;
+ public IntPtr input_mode;
+ public IntPtr status;
+
+ public override string ToString ()
+ {
+ return string.Format("MotifWmHints <flags={0}, functions={1}, decorations={2}, input_mode={3}, status={4}", (MotifFlags) flags.ToInt32 (), (MotifFunctions) functions.ToInt32 (), (MotifDecorations) decorations.ToInt32 (), (MotifInputMode) input_mode.ToInt32 (), status.ToInt32 ());
+ }
+ }
+
+ [Flags]
+ public enum MotifFlags {
+ Functions = 1,
+ Decorations = 2,
+ InputMode = 4,
+ Status = 8
+ }
+
+ [Flags]
+ public enum MotifFunctions {
+ All = 0x01,
+ Resize = 0x02,
+ Move = 0x04,
+ Minimize = 0x08,
+ Maximize = 0x10,
+ Close = 0x20
+ }
+
+ [Flags]
+ public enum MotifDecorations {
+ All = 0x01,
+ Border = 0x02,
+ ResizeH = 0x04,
+ Title = 0x08,
+ Menu = 0x10,
+ Minimize = 0x20,
+ Maximize = 0x40,
+
+ }
+
+ [Flags]
+ public enum MotifInputMode {
+ Modeless = 0,
+ ApplicationModal = 1,
+ SystemModal = 2,
+ FullApplicationModal = 3
+ }
+
+ [Flags]
+ public enum KeyMasks {
+ ShiftMask = (1 << 0),
+ LockMask = (1 << 1),
+ ControlMask = (1 << 2),
+ Mod1Mask = (1 << 3),
+ Mod2Mask = (1 << 4),
+ Mod3Mask = (1 << 5),
+ Mod4Mask = (1 << 6),
+ Mod5Mask = (1 << 7),
+
+ ModMasks = Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask
+ }
+
+ [Flags]
+ public enum MouseKeyMasks {
+ Button1Mask = (1 << 8),
+ Button2Mask = (1 << 9),
+ Button3Mask = (1 << 10),
+ Button4Mask = (1 << 11),
+ Button5Mask = (1 << 12),
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct XModifierKeymap {
+ public int max_keypermod;
+ public IntPtr modifiermap;
+ }
+
+ public enum PropertyMode {
+ Replace = 0,
+ Prepend = 1,
+ Append = 2
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct XKeyBoardState {
+ public int key_click_percent;
+ public int bell_percent;
+ public uint bell_pitch, bell_duration;
+ public IntPtr led_mask;
+ public int global_auto_repeat;
+ public AutoRepeats auto_repeats;
+
+ [StructLayout (LayoutKind.Explicit)]
+ public struct AutoRepeats {
+ [FieldOffset (0)]
+ public byte first;
+
+ [FieldOffset (31)]
+ public byte last;
+ }
+ }
+
+ [Flags]
+ public enum GCFunction {
+ GCFunction = 1<<0,
+ GCPlaneMask = 1<<1,
+ GCForeground = 1<<2,
+ GCBackground = 1<<3,
+ GCLineWidth = 1<<4,
+ GCLineStyle = 1<<5,
+ GCCapStyle = 1<<6,
+ GCJoinStyle = 1<<7,
+ GCFillStyle = 1<<8,
+ GCFillRule = 1<<9,
+ GCTile = 1<<10,
+ GCStipple = 1<<11,
+ GCTileStipXOrigin = 1<<12,
+ GCTileStipYOrigin = 1<<13,
+ GCFont = 1<<14,
+ GCSubwindowMode = 1<<15,
+ GCGraphicsExposures = 1<<16,
+ GCClipXOrigin = 1<<17,
+ GCClipYOrigin = 1<<18,
+ GCClipMask = 1<<19,
+ GCDashOffset = 1<<20,
+ GCDashList = 1<<21,
+ GCArcMode = 1<<22
+ }
+
+ public enum GCJoinStyle {
+ JoinMiter = 0,
+ JoinRound = 1,
+ JoinBevel = 2
+ }
+
+ public enum GCLineStyle {
+ LineSolid = 0,
+ LineOnOffDash = 1,
+ LineDoubleDash = 2
+ }
+
+ public enum GCCapStyle {
+ CapNotLast = 0,
+ CapButt = 1,
+ CapRound = 2,
+ CapProjecting = 3
+ }
+
+ public enum GCFillStyle {
+ FillSolid = 0,
+ FillTiled = 1,
+ FillStippled = 2,
+ FillOpaqueStppled = 3
+ }
+
+ public enum GCFillRule {
+ EvenOddRule = 0,
+ WindingRule = 1
+ }
+
+ public enum GCArcMode {
+ ArcChord = 0,
+ ArcPieSlice = 1
+ }
+
+ public enum GCSubwindowMode {
+ ClipByChildren = 0,
+ IncludeInferiors = 1
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct XGCValues {
+ public GXFunction function;
+ public IntPtr plane_mask;
+ public IntPtr foreground;
+ public IntPtr background;
+ public int line_width;
+ public GCLineStyle line_style;
+ public GCCapStyle cap_style;
+ public GCJoinStyle join_style;
+ public GCFillStyle fill_style;
+ public GCFillRule fill_rule;
+ public GCArcMode arc_mode;
+ public IntPtr tile;
+ public IntPtr stipple;
+ public int ts_x_origin;
+ public int ts_y_origin;
+ public IntPtr font;
+ public GCSubwindowMode subwindow_mode;
+ public bool graphics_exposures;
+ public int clip_x_origin;
+ public int clib_y_origin;
+ public IntPtr clip_mask;
+ public int dash_offset;
+ public byte dashes;
+ }
+
+ public enum GXFunction {
+ GXclear = 0x0, /* 0 */
+ GXand = 0x1, /* src AND dst */
+ GXandReverse = 0x2, /* src AND NOT dst */
+ GXcopy = 0x3, /* src */
+ GXandInverted = 0x4, /* NOT src AND dst */
+ GXnoop = 0x5, /* dst */
+ GXxor = 0x6, /* src XOR dst */
+ GXor = 0x7, /* src OR dst */
+ GXnor = 0x8, /* NOT src AND NOT dst */
+ GXequiv = 0x9, /* NOT src XOR dst */
+ GXinvert = 0xa, /* NOT dst */
+ GXorReverse = 0xb, /* src OR NOT dst */
+ GXcopyInverted = 0xc, /* NOT src */
+ GXorInverted = 0xd, /* NOT src OR dst */
+ GXnand = 0xe, /* NOT src OR NOT dst */
+ GXset = 0xf /* 1 */
+ }
+
+ public enum NetWindowManagerState {
+ Remove = 0,
+ Add = 1,
+ Toggle = 2
+ }
+
+ public enum RevertTo {
+ None = 0,
+ PointerRoot = 1,
+ Parent = 2
+ }
+
+ public enum MapState {
+ IsUnmapped = 0,
+ IsUnviewable = 1,
+ IsViewable = 2
+ }
+
+ public enum CursorFontShape {
+ XC_X_cursor = 0,
+ XC_arrow = 2,
+ XC_based_arrow_down = 4,
+ XC_based_arrow_up = 6,
+ XC_boat = 8,
+ XC_bogosity = 10,
+ XC_bottom_left_corner = 12,
+ XC_bottom_right_corner = 14,
+ XC_bottom_side = 16,
+ XC_bottom_tee = 18,
+ XC_box_spiral = 20,
+ XC_center_ptr = 22,
+
+ XC_circle = 24,
+ XC_clock = 26,
+ XC_coffee_mug = 28,
+ XC_cross = 30,
+ XC_cross_reverse = 32,
+ XC_crosshair = 34,
+ XC_diamond_cross = 36,
+ XC_dot = 38,
+ XC_dotbox = 40,
+ XC_double_arrow = 42,
+ XC_draft_large = 44,
+ XC_draft_small = 46,
+
+ XC_draped_box = 48,
+ XC_exchange = 50,
+ XC_fleur = 52,
+ XC_gobbler = 54,
+ XC_gumby = 56,
+ XC_hand1 = 58,
+ XC_hand2 = 60,
+ XC_heart = 62,
+ XC_icon = 64,
+ XC_iron_cross = 66,
+ XC_left_ptr = 68,
+ XC_left_side = 70,
+
+ XC_left_tee = 72,
+ XC_left_button = 74,
+ XC_ll_angle = 76,
+ XC_lr_angle = 78,
+ XC_man = 80,
+ XC_middlebutton = 82,
+ XC_mouse = 84,
+ XC_pencil = 86,
+ XC_pirate = 88,
+ XC_plus = 90,
+ XC_question_arrow = 92,
+ XC_right_ptr = 94,
+
+ XC_right_side = 96,
+ XC_right_tee = 98,
+ XC_rightbutton = 100,
+ XC_rtl_logo = 102,
+ XC_sailboat = 104,
+ XC_sb_down_arrow = 106,
+ XC_sb_h_double_arrow = 108,
+ XC_sb_left_arrow = 110,
+ XC_sb_right_arrow = 112,
+ XC_sb_up_arrow = 114,
+ XC_sb_v_double_arrow = 116,
+ XC_sb_shuttle = 118,
+
+ XC_sizing = 120,
+ XC_spider = 122,
+ XC_spraycan = 124,
+ XC_star = 126,
+ XC_target = 128,
+ XC_tcross = 130,
+ XC_top_left_arrow = 132,
+ XC_top_left_corner = 134,
+ XC_top_right_corner = 136,
+ XC_top_side = 138,
+ XC_top_tee = 140,
+ XC_trek = 142,
+
+ XC_ul_angle = 144,
+ XC_umbrella = 146,
+ XC_ur_angle = 148,
+ XC_watch = 150,
+ XC_xterm = 152,
+ XC_num_glyphs = 154
+ }
+
+ public enum SystrayRequest {
+ SYSTEM_TRAY_REQUEST_DOCK = 0,
+ SYSTEM_TRAY_BEGIN_MESSAGE = 1,
+ SYSTEM_TRAY_CANCEL_MESSAGE = 2
+ }
+
+ public enum NetWmStateRequest {
+ _NET_WM_STATE_REMOVE = 0,
+ _NET_WM_STATE_ADD = 1,
+ _NET_WM_STATE_TOGGLE = 2
+ }
+
+ public enum NetWmMoveResize {
+ _NET_WM_MOVERESIZE_SIZE_TOPLEFT = 0,
+ _NET_WM_MOVERESIZE_SIZE_TOP = 1,
+ _NET_WM_MOVERESIZE_SIZE_TOPRIGHT = 2,
+ _NET_WM_MOVERESIZE_SIZE_RIGHT = 3,
+ _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT = 4,
+ _NET_WM_MOVERESIZE_SIZE_BOTTOM = 5,
+ _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT = 6,
+ _NET_WM_MOVERESIZE_SIZE_LEFT = 7,
+ _NET_WM_MOVERESIZE_MOVE = 8,
+ _NET_WM_MOVERESIZE_SIZE_KEYBOARD = 9,
+ _NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10,
+ _NET_WM_MOVERESIZE_CANCEL = 11
+ }
+
+ [Flags]
+ public enum XSizeHintsFlags {
+ USPosition = (1 << 0),
+ USSize = (1 << 1),
+ PPosition = (1 << 2),
+ PSize = (1 << 3),
+ PMinSize = (1 << 4),
+ PMaxSize = (1 << 5),
+ PResizeInc = (1 << 6),
+ PAspect = (1 << 7),
+ PAllHints = (PPosition | PSize | PMinSize | PMaxSize | PResizeInc | PAspect),
+ PBaseSize = (1 << 8),
+ PWinGravity = (1 << 9),
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XSizeHints {
+ public IntPtr flags;
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ public int min_width;
+ public int min_height;
+ public int max_width;
+ public int max_height;
+ public int width_inc;
+ public int height_inc;
+ public int min_aspect_x;
+ public int min_aspect_y;
+ public int max_aspect_x;
+ public int max_aspect_y;
+ public int base_width;
+ public int base_height;
+ public int win_gravity;
+ }
+
+ [Flags]
+ public enum XWMHintsFlags {
+ InputHint = (1 << 0),
+ StateHint = (1 << 1),
+ IconPixmapHint = (1 << 2),
+ IconWindowHint = (1 << 3),
+ IconPositionHint = (1 << 4),
+ IconMaskHint = (1 << 5),
+ WindowGroupHint = (1 << 6),
+ AllHints = (InputHint | StateHint | IconPixmapHint | IconWindowHint | IconPositionHint | IconMaskHint | WindowGroupHint)
+ }
+
+ public enum XInitialState {
+ DontCareState = 0,
+ NormalState = 1,
+ ZoomState = 2,
+ IconicState = 3,
+ InactiveState = 4
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XWMHints {
+ public IntPtr flags;
+ public bool input;
+ public XInitialState initial_state;
+ public IntPtr icon_pixmap;
+ public IntPtr icon_window;
+ public int icon_x;
+ public int icon_y;
+ public IntPtr icon_mask;
+ public IntPtr window_group;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XIconSize {
+ public int min_width;
+ public int min_height;
+ public int max_width;
+ public int max_height;
+ public int width_inc;
+ public int height_inc;
+ }
+
+ public struct CaretStruct {
+ public Timer Timer; // Blink interval
+ public IntPtr Hwnd; // Window owning the caret
+ public IntPtr Window; // Actual X11 handle of the window
+ public int X; // X position of the caret
+ public int Y; // Y position of the caret
+ public int Width; // Width of the caret; if no image used
+ public int Height; // Height of the caret, if no image used
+ public bool Visible; // Is caret visible?
+ public bool On; // Caret blink display state: On/Off
+ public IntPtr gc; // Graphics context
+ public bool Paused; // Don't update right now
+ }
+
+ public struct HoverStruct {
+ public Timer Timer; // for hovering
+ public IntPtr Window; // Last window we entered; used to generate WM_MOUSEHOVER (handle is X11 handle)
+ public int X; // Last MouseMove X coordinate; used to generate WM_MOUSEHOVER
+ public int Y; // Last MouseMove Y coordinate; used to generate WM_MOUSEHOVER
+ public Size Size; // Size of the rectangle the mouse has to stay in to generate hover
+ public int Interval; // in milliseconds, how long to hold before hover is generated
+ public IntPtr Atom; // X Atom
+ }
+
+ /*public struct ClickStruct {
+ public IntPtr Hwnd; //
+ public Msg Message; //
+ public IntPtr wParam; //
+ public IntPtr lParam; //
+ public long Time; // Last time we received a mouse click
+ public bool Pending; // True if we haven't sent the last mouse click
+ }*/
+
+ public struct GrabStruct {
+ public bool Confined; // Is the current grab (if any) confined to grab_area?
+ public IntPtr Hwnd; // The window that is grabbed
+ public Rectangle Area; // The area the current grab is confined to
+ }
+
+ public delegate int XErrorHandler(IntPtr DisplayHandle, ref XErrorEvent error_event);
+
+ public enum XRequest : byte {
+ X_CreateWindow = 1,
+ X_ChangeWindowAttributes = 2,
+ X_GetWindowAttributes = 3,
+ X_DestroyWindow = 4,
+ X_DestroySubwindows = 5,
+ X_ChangeSaveSet = 6,
+ X_ReparentWindow = 7,
+ X_MapWindow = 8,
+ X_MapSubwindows = 9,
+ X_UnmapWindow = 10,
+ X_UnmapSubwindows = 11,
+ X_ConfigureWindow = 12,
+ X_CirculateWindow = 13,
+ X_GetGeometry = 14,
+ X_QueryTree = 15,
+ X_InternAtom = 16,
+ X_GetAtomName = 17,
+ X_ChangeProperty = 18,
+ X_DeleteProperty = 19,
+ X_GetProperty = 20,
+ X_ListProperties = 21,
+ X_SetSelectionOwner = 22,
+ X_GetSelectionOwner = 23,
+ X_ConvertSelection = 24,
+ X_SendEvent = 25,
+ X_GrabPointer = 26,
+ X_UngrabPointer = 27,
+ X_GrabButton = 28,
+ X_UngrabButton = 29,
+ X_ChangeActivePointerGrab = 30,
+ X_GrabKeyboard = 31,
+ X_UngrabKeyboard = 32,
+ X_GrabKey = 33,
+ X_UngrabKey = 34,
+ X_AllowEvents = 35,
+ X_GrabServer = 36,
+ X_UngrabServer = 37,
+ X_QueryPointer = 38,
+ X_GetMotionEvents = 39,
+ X_TranslateCoords = 40,
+ X_WarpPointer = 41,
+ X_SetInputFocus = 42,
+ X_GetInputFocus = 43,
+ X_QueryKeymap = 44,
+ X_OpenFont = 45,
+ X_CloseFont = 46,
+ X_QueryFont = 47,
+ X_QueryTextExtents = 48,
+ X_ListFonts = 49,
+ X_ListFontsWithInfo = 50,
+ X_SetFontPath = 51,
+ X_GetFontPath = 52,
+ X_CreatePixmap = 53,
+ X_FreePixmap = 54,
+ X_CreateGC = 55,
+ X_ChangeGC = 56,
+ X_CopyGC = 57,
+ X_SetDashes = 58,
+ X_SetClipRectangles = 59,
+ X_FreeGC = 60,
+ X_ClearArea = 61,
+ X_CopyArea = 62,
+ X_CopyPlane = 63,
+ X_PolyPoint = 64,
+ X_PolyLine = 65,
+ X_PolySegment = 66,
+ X_PolyRectangle = 67,
+ X_PolyArc = 68,
+ X_FillPoly = 69,
+ X_PolyFillRectangle = 70,
+ X_PolyFillArc = 71,
+ X_PutImage = 72,
+ X_GetImage = 73,
+ X_PolyText8 = 74,
+ X_PolyText16 = 75,
+ X_ImageText8 = 76,
+ X_ImageText16 = 77,
+ X_CreateColormap = 78,
+ X_FreeColormap = 79,
+ X_CopyColormapAndFree = 80,
+ X_InstallColormap = 81,
+ X_UninstallColormap = 82,
+ X_ListInstalledColormaps = 83,
+ X_AllocColor = 84,
+ X_AllocNamedColor = 85,
+ X_AllocColorCells = 86,
+ X_AllocColorPlanes = 87,
+ X_FreeColors = 88,
+ X_StoreColors = 89,
+ X_StoreNamedColor = 90,
+ X_QueryColors = 91,
+ X_LookupColor = 92,
+ X_CreateCursor = 93,
+ X_CreateGlyphCursor = 94,
+ X_FreeCursor = 95,
+ X_RecolorCursor = 96,
+ X_QueryBestSize = 97,
+ X_QueryExtension = 98,
+ X_ListExtensions = 99,
+ X_ChangeKeyboardMapping = 100,
+ X_GetKeyboardMapping = 101,
+ X_ChangeKeyboardControl = 102,
+ X_GetKeyboardControl = 103,
+ X_Bell = 104,
+ X_ChangePointerControl = 105,
+ X_GetPointerControl = 106,
+ X_SetScreenSaver = 107,
+ X_GetScreenSaver = 108,
+ X_ChangeHosts = 109,
+ X_ListHosts = 110,
+ X_SetAccessControl = 111,
+ X_SetCloseDownMode = 112,
+ X_KillClient = 113,
+ X_RotateProperties = 114,
+ X_ForceScreenSaver = 115,
+ X_SetPointerMapping = 116,
+ X_GetPointerMapping = 117,
+ X_SetModifierMapping = 118,
+ X_GetModifierMapping = 119,
+ X_NoOperation = 127
+ }
+
+ [Flags]
+ public enum XIMProperties {
+ XIMPreeditArea = 0x0001,
+ XIMPreeditCallbacks = 0x0002,
+ XIMPreeditPosition = 0x0004,
+ XIMPreeditNothing = 0x0008,
+ XIMPreeditNone = 0x0010,
+ XIMStatusArea = 0x0100,
+ XIMStatusCallbacks = 0x0200,
+ XIMStatusNothing = 0x0400,
+ XIMStatusNone = 0x0800,
+ }
+
+ [Flags]
+ public enum WindowType {
+ Client = 1,
+ Whole = 2,
+ Both = 3
+ }
+
+ public enum XEmbedMessage {
+ EmbeddedNotify = 0,
+ WindowActivate = 1,
+ WindowDeactivate = 2,
+ RequestFocus = 3,
+ FocusIn = 4,
+ FocusOut = 5,
+ FocusNext = 6,
+ FocusPrev = 7,
+ /* 8-9 were used for XEMBED_GRAB_KEY/XEMBED_UNGRAB_KEY */
+ ModalityOn = 10,
+ ModalityOff = 11,
+ RegisterAccelerator = 12,
+ UnregisterAccelerator = 13,
+ ActivateAccelerator = 14
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct XcursorImage
+ {
+ private int version;
+ public int size; /* nominal size for matching */
+ public int width; /* actual width */
+ public int height; /* actual height */
+ public int xhot; /* hot spot x (must be inside image) */
+ public int yhot; /* hot spot y (must be inside image) */
+ public int delay; /* hot spot y (must be inside image) */
+ public IntPtr pixels; /* pointer to pixels */
+
+ public override string ToString ()
+ {
+ return string.Format ("XCursorImage (version: {0}, size: {1}, width: {2}, height: {3}, xhot: {4}, yhot: {5}, delay: {6}, pixels: {7}",
+ version, size, width, height, xhot, yhot, delay, pixels);
+ }
+ } ;
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct XcursorImages
+ {
+ public int nimage; /* number of images */
+ public IntPtr images; /* array of XcursorImage pointers */
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct XIMStyles
+ {
+ public ushort count_styles;
+ public IntPtr supported_styles;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ [Serializable]
+ public class XPoint
+ {
+ public short X;
+ public short Y;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ [Serializable]
+ public class XIMCallback
+ {
+ public IntPtr client_data;
+ public XIMProc callback;
+ [NonSerialized]
+ GCHandle gch;
+
+ public XIMCallback (IntPtr clientData, XIMProc proc)
+ {
+ this.client_data = clientData;
+ this.gch = GCHandle.Alloc (proc);
+ this.callback = proc;
+ }
+
+ ~XIMCallback ()
+ {
+ gch.Free ();
+ }
+ }
+
+ public enum XIMFeedback
+ {
+ Reverse = 1,
+ Underline = 2,
+ Highlight = 4,
+ Primary = 32,
+ Secondary = 64,
+ Tertiary = 128,
+ }
+
+ public struct XIMFeedbackStruct
+ {
+ public byte FeedbackMask; // one or more of XIMFeedback enum
+ }
+
+ public struct XIMText
+ {
+ public ushort Length;
+ public IntPtr Feedback; // to XIMFeedbackStruct
+ public bool EncodingIsWChar;
+ public IntPtr String; // it could be either char* or wchar_t*
+ }
+
+ public struct XIMPreeditDrawCallbackStruct
+ {
+ public int Caret;
+ public int ChangeFirst;
+ public int ChangeLength;
+ public IntPtr Text; // to XIMText
+ }
+
+ public enum XIMCaretDirection
+ {
+ XIMForwardChar,
+ XIMBackwardChar,
+ XIMForwardWord,
+ XIMBackwardWord,
+ XIMCaretUp,
+ XIMCaretDown,
+ XIMNextLine,
+ XIMPreviousLine,
+ XIMLineStart,
+ XIMLineEnd,
+ XIMAbsolutePosition,
+ XIMDontChange
+ }
+
+ public enum XIMCaretStyle
+ {
+ IsInvisible,
+ IsPrimary,
+ IsSecondary
+ }
+
+ public struct XIMPreeditCaretCallbackStruct
+ {
+ public int Position;
+ public XIMCaretDirection Direction;
+ public XIMCaretStyle Style;
+ }
+
+ // only PreeditStartCallback requires return value though.
+ public delegate int XIMProc (IntPtr xim, IntPtr clientData, IntPtr callData);
+
+ public static class XNames
+ {
+ public const string XNVaNestedList = "XNVaNestedList";
+ public const string XNQueryInputStyle = "queryInputStyle";
+ public const string XNClientWindow = "clientWindow";
+ public const string XNInputStyle = "inputStyle";
+ public const string XNFocusWindow = "focusWindow";
+
+ // XIMPreeditCallbacks delegate names.
+ public const string XNPreeditStartCallback = "preeditStartCallback";
+ public const string XNPreeditDoneCallback = "preeditDoneCallback";
+ public const string XNPreeditDrawCallback = "preeditDrawCallback";
+ public const string XNPreeditCaretCallback = "preeditCaretCallback";
+ public const string XNPreeditStateNotifyCallback = "preeditStateNotifyCallback";
+ public const string XNPreeditAttributes = "preeditAttributes";
+ // XIMStatusCallbacks delegate names.
+ public const string XNStatusStartCallback = "statusStartCallback";
+ public const string XNStatusDoneCallback = "statusDoneCallback";
+ public const string XNStatusDrawCallback = "statusDrawCallback";
+ public const string XNStatusAttributes = "statusAttributes";
+
+ public const string XNArea = "area";
+ public const string XNAreaNeeded = "areaNeeded";
+ public const string XNSpotLocation = "spotLocation";
+ public const string XNFontSet = "fontSet";
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct XineramaScreenInfo
+ {
+ public int screen_number;
+ public short x_org;
+ public short y_org;
+ public short width;
+ public short height;
+ }
+}