}
#endregion
-<<<<<<< 70bcdc77ff42c74fcd8e6e7dffd4eb6b16f24f39
- public List<GraphicObject> GraphicObjects = new List<GraphicObject>();
- public Color Background = Color.Transparent;
-
- internal static OpenTKGameWindow currentWindow;
-
- Rectangles _redrawClip = new Rectangles();//should find another way to access it from child
- List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();
-
- #region IGOLibHost implementation
- public Rectangles clipping {
- get { return _redrawClip; }
- set { _redrawClip = value; }
- }
- public XCursor MouseCursor {
- set {
-// if (value == null) {
-// Cursor = null;
-// return;
-// }
-// Cursor = new MouseCursor
-// ((int)value.Xhot, (int)value.Yhot, (int)value.Width, (int)value.Height,value.data);
- }
- }
- public List<GraphicObject> gobjsToRedraw {
- get { return _gobjsToRedraw; }
- set { _gobjsToRedraw = value; }
- }
- public void AddWidget(GraphicObject g)
- {
- g.Parent = this;
- GraphicObjects.Insert (0, g);
-
- g.RegisterForLayouting (LayoutingType.Sizing);
- }
- public void DeleteWidget(GraphicObject g)
- {
- g.Visible = false;//trick to ensure clip is added to refresh zone
- g.ClearBinding();
- GraphicObjects.Remove (g);
- }
- public void PutOnTop(GraphicObject g)
- {
- if (GraphicObjects.IndexOf(g) > 0)
- {
- GraphicObjects.Remove(g);
- GraphicObjects.Insert(0, g);
- //g.registerClipRect ();
- }
- }
- public void Quit ()
- {
- Gtk.Application.Quit ();
- }
-
- #region focus
- GraphicObject _activeWidget; //button is pressed on widget
- GraphicObject _hoverWidget; //mouse is over
- GraphicObject _focusedWidget; //has keyboard (or other perif) focus
-
- public GraphicObject activeWidget
- {
- get { return _activeWidget; }
- set
- {
- if (_activeWidget == value)
- return;
-
- if (_activeWidget != null)
- _activeWidget.IsActive = false;
-
- _activeWidget = value;
-
- if (_activeWidget != null)
- _activeWidget.IsActive = true;
- }
- }
- public GraphicObject hoverWidget
- {
- get { return _hoverWidget; }
- set {
- if (_hoverWidget == value)
- return;
- _hoverWidget = value;
- }
- }
- public GraphicObject FocusedWidget {
- get { return _focusedWidget; }
- set {
- if (_focusedWidget == value)
- return;
- if (_focusedWidget != null)
- _focusedWidget.onUnfocused (this, null);
- _focusedWidget = value;
- if (_focusedWidget != null)
- _focusedWidget.onFocused (this, null);
- }
- }
- #endregion
-
- #endregion
-
- /// <summary> Remove all Graphic objects from top container </summary>
- public void ClearInterface()
- {
- int i = 0;
- while (GraphicObjects.Count>0) {
- //TODO:parent is not reset to null because object will be added
- //to ObjectToRedraw list, and without parent, it fails
- GraphicObject g = GraphicObjects [i];
- g.Visible = false;
- g.ClearBinding ();
- GraphicObjects.RemoveAt (0);
- }
- }
- public GraphicObject FindByName (string nameToFind)
- {
- foreach (GraphicObject w in GraphicObjects) {
- GraphicObject r = w.FindByName (nameToFind);
- if (r != null)
- return r;
- }
- return null;
- }
- #region Events
- //those events are raised only if mouse isn't in a graphic object
- public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;
- public event EventHandler<MouseButtonEventArgs> MouseButtonUp;
- public event EventHandler<MouseButtonEventArgs> MouseButtonDown;
- public event EventHandler<MouseButtonEventArgs> MouseClick;
- public event EventHandler<MouseMoveEventArgs> MouseMove;
- public event EventHandler<KeyboardKeyEventArgs> KeyboardKeyDown;
- #endregion
-
- #region graphic contexte
- Context ctx;
- Surface surf;
- byte[] bmp;
-
-=======
protected void Quit (object sender, EventArgs e)
{
Gtk.Application.Quit ();
}
->>>>>>> CrowInterface object holding common functions, IGOLibHost removed
+
void Win_Drawn (object o, Gtk.DrawnArgs args)
{
if (CrowInterface.IsDirty) {
- byte[] tmp = new byte[4 * CrowInterface.DirtyRect.Width * CrowInterface.DirtyRect.Height];
- for (int y = 0; y < CrowInterface.DirtyRect.Height; y++) {
- Array.Copy(CrowInterface.bmp,
- ((CrowInterface.DirtyRect.Top + y) * CrowInterface.ClientRectangle.Width * 4) + CrowInterface.DirtyRect.Left * 4,
- tmp, y * CrowInterface.DirtyRect.Width * 4, CrowInterface.DirtyRect.Width *4);
- }
- using (ImageSurface img = new ImageSurface (tmp, Format.Argb32, CrowInterface.DirtyRect.Width, CrowInterface.DirtyRect.Height, 4 * CrowInterface.DirtyRect.Width)) {
+ using (ImageSurface img = new ImageSurface (CrowInterface.dirtyBmp, Format.Argb32, CrowInterface.DirtyRect.Width, CrowInterface.DirtyRect.Height, 4 * CrowInterface.DirtyRect.Width)) {
args.Cr.SetSourceSurface (img, CrowInterface.DirtyRect.X, CrowInterface.DirtyRect.Y);
args.Cr.Paint();
}
+++ /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)' == '' ">Linux_x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{819640AC-C8B0-4E4A-9845-B24D5402F836}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>LinuxCrow</RootNamespace>
- <AssemblyName>LinuxCrow</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Linux_x86' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Linux_x86' ">
- <DebugType>full</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file