#region Public Properties
- internal override int Caption {
+ internal override int CaptionHeight {
get { return 19; }
}
}
internal override Size FrameBorderSize {
- get { throw new NotImplementedException(); }
+ get { return new Size (4, 4); }
}
internal override Size IconSize {
internal override Size MaxWindowTrackSize {
get { return new Size (WorkingArea.Width, WorkingArea.Height); }
- }
+ }
- internal override Size MinimizedWindowSize {
- get { return new Size(1, 1); }
- }
+ internal override bool MenuAccessKeysUnderlined {
+ get {
+ return false;
+ }
+ }
internal override Size MinimizedWindowSpacingSize {
get { return new Size(1, 1); }
get { return new Size(1, 1); }
}
- internal override Size MinWindowTrackSize {
- get { return new Size(1, 1); }
- }
-
internal override Keys ModifierKeys {
get { return display.ModifierKeys; }
}
}
internal override Rectangle VirtualScreen {
- get { return WorkingArea; }
+ get { return display.VirtualScreen; }
}
internal override Rectangle WorkingArea {
#endregion // Public properties
#region Public Static Methods
- internal override IntPtr InitializeDriver()
+ internal override void RaiseIdle (EventArgs e)
+ {
+ X11ThreadQueue queue = ThreadQueue (Thread.CurrentThread);
+ queue.OnIdle (e);
+ }
+
+ internal override IntPtr InitializeDriver ()
{
lock (this) {
if (display == null)
}
// XXX this implementation should probably be shared between all non-win32 backends
- internal override bool CalculateWindowRect (ref Rectangle ClientRect, int Style, int ExStyle, Menu menu, out Rectangle WindowRect)
+ internal override bool CalculateWindowRect (ref Rectangle ClientRect, CreateParams cp, Menu menu, out Rectangle WindowRect)
{
- FormBorderStyle border_style;
- TitleStyle title_style;
- int caption_height;
- int tool_caption_height;
-
- // XXX this method should be static on Hwnd, not X11Hwnd
- X11Hwnd.DeriveStyles (Style, ExStyle, out border_style, out title_style,
- out caption_height, out tool_caption_height);
-
- WindowRect = Hwnd.GetWindowRectangle(border_style, menu, title_style,
- caption_height, tool_caption_height,
- ClientRect);
+ WindowRect = Hwnd.GetWindowRectangle (cp, menu, ClientRect);
return true;
}
{
return display.DefineCursor (bitmap, mask, cursor_pixel, mask_pixel, xHotSpot, yHotSpot);
}
-
+ internal override Bitmap DefineStdCursorBitmap (StdCursor id)
+ {
+ return display.DefineStdCursorBitmap (id);
+ }
internal override IntPtr DefineStdCursor (StdCursor id)
{
return display.DefineStdCursor (id);
return display.DispatchMessage (ref msg);
}
+ internal override void DrawReversibleLine (Point start, Point end, Color backColor)
+ {
+ display.DrawReversibleLine (start, end, backColor);
+ }
+
+ internal override void FillReversibleRectangle (Rectangle rectangle, Color backColor)
+ {
+ display.FillReversibleRectangle (rectangle, backColor);
+ }
+
+ internal override void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style)
+ {
+ display.DrawReversibleFrame (rectangle, backColor, style);
+ }
+
internal override void DrawReversibleRectangle (IntPtr handle, Rectangle rect, int line_width)
{
X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);
return IntPtr.Zero;
}
+ // This is a nop on win32 and x11
+ internal override IntPtr GetPreviousWindow(IntPtr handle) {
+ return handle;
+ }
+
internal override void GetCursorPos (IntPtr handle, out int x, out int y)
{
display.GetCursorPos ((X11Hwnd)Hwnd.ObjectFromHandle(handle),
// XXX this should be shared amongst non-win32 backends
internal override bool GetFontMetrics (Graphics g, Font font, out int ascent, out int descent)
{
- return Xlib.GetFontMetrics(g.GetHdc(), font.ToHfont(), out ascent, out descent);
+ FontFamily ff = font.FontFamily;
+ ascent = ff.GetCellAscent (font.Style);
+ descent = ff.GetCellDescent (font.Style);
+ return true;
}
display.OverrideCursor = cursor;
}
- internal override PaintEventArgs PaintEventStart (IntPtr handle, bool client)
+ internal override PaintEventArgs PaintEventStart (ref Message m, IntPtr handle, bool client)
{
- return display.PaintEventStart (handle, client);
+ return display.PaintEventStart (ref m, handle, client);
}
- internal override void PaintEventEnd (IntPtr handle, bool client)
+ internal override void PaintEventEnd (ref Message m, IntPtr handle, bool client)
{
- display.PaintEventEnd (handle, client);
+ display.PaintEventEnd (ref m, handle, client);
}
internal override void PostQuitMessage(int exitCode)
{
+ display.PostMessage (display.FosterParent.Handle, Msg.WM_QUIT, IntPtr.Zero, IntPtr.Zero);
display.Flush ();
- ThreadQueue(Thread.CurrentThread).PostQuitState = true;
}
[MonoTODO]
return display.SendMessage (handle, message, wParam, lParam);
}
+ internal override int SendInput(IntPtr handle, Queue keys) {
+ return display.SendInput(handle, keys);
+ }
+
+
internal override void SetAllowDrop (IntPtr handle, bool value)
{
// We allow drop on all windows
queue.SetTimer (timer);
}
- internal override bool SetTopmost(IntPtr handle, IntPtr handle_owner, bool enabled)
+ internal override bool SetTopmost(IntPtr handle, bool enabled)
+ {
+ X11Hwnd hwnd = (X11Hwnd) Hwnd.ObjectFromHandle (handle);
+
+ if (hwnd == null)
+ return false;
+
+ return hwnd.SetTopmost (enabled);
+ }
+
+ internal override bool SetOwner(IntPtr handle, IntPtr handle_owner)
{
X11Hwnd hwnd;
X11Hwnd hwnd_owner = (X11Hwnd)Hwnd.ObjectFromHandle(handle_owner);
- return hwnd.SetTopmost (hwnd_owner, enabled);
+ return hwnd.SetOwner (hwnd_owner);
}
internal override bool SetVisible (IntPtr handle, bool visible, bool activate)
}
}
- internal override void SetWindowTransparency(IntPtr handle, double transparency, Color key)
+ internal override double GetWindowTransparency (IntPtr handle)
+ {
+ X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);
+
+ if (hwnd != null)
+ return hwnd.GetWindowTransparency ();
+ else
+ return 0.0;
+ }
+
+ internal override void SetWindowTransparency (IntPtr handle, double transparency, Color key)
{
X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);
return (object) ThreadQueue(thread);
}
- internal override bool SupportsTransparency()
+ internal override TransparencySupport SupportsTransparency()
{
return display.SupportsTransparency ();
}
display.SystrayRemove (handle, ref tt);
}
+ NotifyIcon.BalloonWindow balloon_window;
+
+ internal override void SystrayBalloon(IntPtr handle, int timeout, string title, string text, ToolTipIcon icon)
+ {
+ Control control = Control.FromHandle(handle);
+
+ if (control == null)
+ return;
+
+ if (balloon_window != null) {
+ balloon_window.Close ();
+ balloon_window.Dispose ();
+ }
+
+ balloon_window = new NotifyIcon.BalloonWindow (handle);
+ balloon_window.Title = title;
+ balloon_window.Text = text;
+ balloon_window.Timeout = timeout;
+ balloon_window.Show ();
+
+ SendMessage(handle, Msg.WM_USER, IntPtr.Zero, (IntPtr) Msg.NIN_BALLOONSHOW);
+ }
+
internal override bool Text (IntPtr handle, string text)
{
X11Hwnd hwnd = (X11Hwnd) Hwnd.ObjectFromHandle(handle);
hwnd.Update ();
}
+ internal override void CreateOffscreenDrawable (IntPtr handle,
+ int width, int height,
+ out object offscreen_drawable)
+ {
+ display.CreateOffscreenDrawable (handle, width, height,
+ out offscreen_drawable);
+ }
+
+ internal override void DestroyOffscreenDrawable (object offscreen_drawable)
+ {
+ display.DestroyOffscreenDrawable (offscreen_drawable);
+ }
+
+ internal override Graphics GetOffscreenGraphics (object offscreen_drawable)
+ {
+ return display.GetOffscreenGraphics (offscreen_drawable);
+ }
+
+ internal override void BlitFromOffscreen (IntPtr dest_handle,
+ Graphics dest_dc,
+ object offscreen_drawable,
+ Graphics offscreen_dc,
+ Rectangle r)
+ {
+ display.BlitFromOffscreen (dest_handle, dest_dc, offscreen_drawable, offscreen_dc, r);
+ }
+
#endregion // Public Static Methods
#region Events