00001 #region License
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #endregion
00027
00028 using System;
00029 using System.Collections.Generic;
00030 using System.Text;
00031
00032 namespace OpenTK.Platform.X11
00033 {
00036 sealed class X11WindowInfo : IWindowInfo
00037 {
00038 IntPtr handle, rootWindow, display;
00039 X11WindowInfo parent;
00040 int screen;
00041 XVisualInfo visualInfo;
00042 EventMask eventMask;
00043
00044 #region --- Constructors ---
00045
00046 #region X11WindowInfo()
00047
00049 public X11WindowInfo() { }
00050
00051 #endregion
00052
00053 #region X11WindowInfo(IntPtr handle, X11WindowInfo parent)
00054
00060 public X11WindowInfo(IntPtr handle, X11WindowInfo parent)
00061 {
00062 this.handle = handle;
00063 this.parent = parent;
00064 if (parent != null)
00065 {
00066 this.rootWindow = parent.rootWindow;
00067 this.display = parent.display;
00068 this.screen = parent.screen;
00069 this.visualInfo = parent.visualInfo;
00070 }
00071 }
00072
00073 #endregion
00074
00075 #endregion
00076
00077 #region --- Public Methods ---
00078
00080 public IntPtr WindowHandle { get { return handle; } set { handle = value; } }
00082 public X11WindowInfo Parent { get { return parent; } set { parent = value; } }
00084 public IntPtr RootWindow { get { return rootWindow; } set { rootWindow = value; } }
00086 public IntPtr Display { get { return display; } set { display = value; } }
00088 public int Screen { get { return screen; } set { screen = value; } }
00090 public XVisualInfo VisualInfo { get { return visualInfo; } set { visualInfo = value; } }
00092 public EventMask EventMask { get { return eventMask; } set { eventMask = value; } }
00093
00094 #endregion
00095
00096 #region --- IDisposable Members ---
00097
00101 public void Dispose()
00102 {
00103 }
00104
00105 #endregion
00106
00107 #region --- Overrides ---
00108
00109 #region public override string ToString()
00110
00113 public override string ToString()
00114 {
00115 return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}, Parent: ({3})",
00116 this.Display, this.Screen, this.WindowHandle, this.Parent != null ? this.Parent.ToString() : "null");
00117 }
00118
00119 #endregion
00120
00124 public override bool Equals(object obj)
00125 {
00126 if (obj == null) return false;
00127 if (this.GetType() != obj.GetType()) return false;
00128 X11WindowInfo info = (X11WindowInfo)obj;
00129
00130 if (info == null) return false;
00131
00132 return object.Equals(display, info.display) &&
00133 handle.Equals(info.handle);
00134 }
00135
00138 public override int GetHashCode()
00139 {
00140 return handle.GetHashCode() ^ display.GetHashCode();
00141 }
00142
00143 #endregion
00144 }
00145 }