internal virtual NSSize willResize(NSWindow sender, NSSize toFrameSize) { //ToolStripManager.FireAppClicked(); //var hwnd = Hwnd.GetObjectFromWindow (this.ContentView.Handle); var rect = new XplatUIWin32.RECT(); rect.left = rect.top = 0; rect.right = (int)toFrameSize.Width; rect.bottom = (int)toFrameSize.Height; IntPtr lpRect = Marshal.AllocHGlobal(Marshal.SizeOf(rect)); Marshal.StructureToPtr(rect, lpRect, false); //FIXME - deduce WMSZ IntPtr wParam = new IntPtr(8); //WMSZ_BOTTOMRIGHT; NativeWindow.WndProc(ContentView.Handle, Msg.WM_SIZING, wParam, lpRect); var rect2 = (Rectangle)Marshal.PtrToStructure(lpRect, typeof(Rectangle)); toFrameSize.Width = rect2.Width; toFrameSize.Height = rect2.Height; Marshal.FreeHGlobal(lpRect); return(toFrameSize); }
protected virtual unsafe void OnDragging(NSEvent e) { var p = driver.NativeToMonoScreen(Frame.Location); var rect = new XplatUIWin32.RECT[] { new XplatUIWin32.RECT(p.X, p.Y, p.X + (int)Frame.Width, p.Y + (int)Frame.Height) }; fixed(void *r = &rect[0]) driver.SendMessage(ContentView?.Handle ?? IntPtr.Zero, Msg.WM_MOVING, IntPtr.Zero, new IntPtr(r)); }
public int UxThemeDrawThemeText(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string text, TextFormatFlags textFlags, Rectangle_ bounds) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); int result = UXTheme.DrawThemeText(hTheme, dc.GetHdc(), iPartId, iStateId, text, text.Length, (uint)textFlags, 0, ref BoundsRect); dc.ReleaseHdc(); return(result); }
public int UxThemeDrawThemeBackground(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle_ bounds) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); int result = UXTheme.DrawThemeBackground(hTheme, dc.GetHdc(), iPartId, iStateId, ref BoundsRect, IntPtr.Zero); dc.ReleaseHdc(); return(result); }
public int UxThemeDrawThemeEdge(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle_ bounds, Edges edges, EdgeStyle style, EdgeEffects effects, out Rectangle_ result) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); XplatUIWin32.RECT retval; int hresult = UXTheme.DrawThemeEdge(hTheme, dc.GetHdc(), iPartId, iStateId, ref BoundsRect, (uint)style, (uint)edges + (uint)effects, out retval); dc.ReleaseHdc(); result = retval.ToRectangle(); return(hresult); }
public int UxThemeHitTestThemeBackground(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, HitTestOptions options, Rectangle_ backgroundRectangle, IntPtr hrgn, Point_ pt, out HitTestCode result) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(backgroundRectangle); HitTestCode retval; int hresult = UXTheme.HitTestThemeBackground(hTheme, dc.GetHdc(), iPartId, iStateId, (uint)options, ref BoundsRect, hrgn, new POINT(pt.X, pt.Y), out retval); dc.ReleaseHdc(); result = (HitTestCode)retval; return(hresult); }
public int UxThemeGetThemeTextExtent(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, string textToDraw, TextFormatFlags flags, Rectangle_ bounds, out Rectangle_ result) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); XplatUIWin32.RECT retval; int hresult = UXTheme.GetThemeTextExtent(hTheme, dc.GetHdc(), iPartId, iStateId, textToDraw, textToDraw.Length, (int)flags, ref BoundsRect, out retval); dc.ReleaseHdc(); result = retval.ToRectangle(); return(hresult); }
public int UxThemeGetThemePartSize(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle_ bounds, ThemeSizeType type, out Size_ result) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); UXTheme.SIZE retval; int hresult = UXTheme.GetThemePartSize(hTheme, dc.GetHdc(), iPartId, iStateId, ref BoundsRect, (int)type, out retval); dc.ReleaseHdc(); result = retval.ToSize(); return(hresult); }
public int UxThemeGetThemeBackgroundContentRect(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle_ bounds, out Rectangle_ result) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); XplatUIWin32.RECT retval; int hresult = UXTheme.GetThemeBackgroundContentRect(hTheme, dc.GetHdc(), iPartId, iStateId, ref BoundsRect, out retval); dc.ReleaseHdc(); result = retval.ToRectangle(); return(hresult); }
public int UxThemeGetThemeBackgroundRegion(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Region result) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); IntPtr retval; int hresult = UXTheme.GetThemeBackgroundRegion(hTheme, dc.GetHdc(), iPartId, iStateId, ref BoundsRect, out retval); dc.ReleaseHdc(); result = Region.FromHrgn(retval); return(hresult); }
internal virtual unsafe NSSize WindowWillResize(NSWindow sender, NSSize size) { var rect = new XplatUIWin32.RECT[] { new XplatUIWin32.RECT(0, 0, (int)size.Width, (int)size.Height) }; //FIXME - deduce WMSZ var wParam = new IntPtr(8); //WMSZ_BOTTOMRIGHT; fixed(void *ptr = &rect[0]) Application.SendMessage(ContentView.Handle, Msg.WM_SIZING, wParam, new IntPtr(ptr)); return(new NSSize(rect[0].Width, rect[0].Height)); }
public void VisualStyleRendererDrawBackgroundExcludingArea(IntPtr theme, IDeviceContext dc, int part, int state, Rectangle_ bounds, Rectangle_ excludedArea) { XplatUIWin32.RECT bounds_rect = XplatUIWin32.RECT.FromRectangle(bounds); IntPtr hdc = dc.GetHdc(); XplatUIWin32.Win32ExcludeClipRect(hdc, excludedArea.Left, excludedArea.Top, excludedArea.Right, excludedArea.Bottom); UXTheme.DrawThemeBackground(theme, hdc, part, state, ref bounds_rect, IntPtr.Zero); IntPtr hrgn = XplatUIWin32.Win32CreateRectRgn(excludedArea.Left, excludedArea.Top, excludedArea.Right, excludedArea.Bottom); XplatUIWin32.Win32ExtSelectClipRgn(hdc, hrgn, (int)ClipCombineMode.RGN_OR); XplatUIWin32.Win32DeleteObject(hrgn); dc.ReleaseHdc(); }
public int UxThemeDrawThemeParentBackground(IDeviceContext dc, Rectangle_ bounds, Control childControl) { int result; XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); using (Graphics g = Graphics.FromHwnd(childControl.Handle)) { IntPtr hdc = g.GetHdc(); result = UXTheme.DrawThemeParentBackground(childControl.Handle, hdc, ref BoundsRect); g.ReleaseHdc(hdc); } return(result); }
internal virtual NSSize WindowWillResize(NSWindow sender, NSSize toFrameSize) { var rect = new XplatUIWin32.RECT(0, 0, (int)toFrameSize.Width, (int)toFrameSize.Height); IntPtr lpRect = Marshal.AllocHGlobal(Marshal.SizeOf(rect)); Marshal.StructureToPtr(rect, lpRect, false); //FIXME - deduce WMSZ IntPtr wParam = new IntPtr(8); //WMSZ_BOTTOMRIGHT; NativeWindow.WndProc(ContentView.Handle, Msg.WM_SIZING, wParam, lpRect); var rect2 = (Rectangle)Marshal.PtrToStructure(lpRect, typeof(Rectangle)); toFrameSize.Width = rect2.Width; toFrameSize.Height = rect2.Height; Marshal.FreeHGlobal(lpRect); return(toFrameSize); }
public extern static Int32 GetThemeBackgroundContentRect(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pBoundingRect, out XplatUIWin32.RECT pContentRect);
public extern static Int32 DrawThemeText(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, String text, int textLength, UInt32 textFlags, UInt32 textFlags2, ref XplatUIWin32.RECT pRect);
public extern static Int32 DrawThemeParentBackground(IntPtr hWnd, IntPtr hdc, ref XplatUIWin32.RECT pRect);
public extern static Int32 DrawThemeIcon(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, IntPtr himl, int iImageIndex);
public extern static Int32 DrawThemeEdge(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pDestRect, uint edge, uint flags, int pRect);
public extern static Int32 DrawThemeBackground(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, IntPtr pClipRect);
public extern static Int32 HitTestThemeBackground(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, UInt32 dwOptions, ref XplatUIWin32.RECT pRect, IntPtr hrgn, POINT ptTest, out int code);
public extern static Int32 GetThemeTextExtent(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, String text, int textLength, int textFlags, int boundingRect, out XplatUIWin32.RECT extentRect);
public extern static Int32 GetThemePartSize(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, int eSize, out SIZE size);
public int UxThemeGetThemeBackgroundExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle contentBounds, out Rectangle result) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle (contentBounds); XplatUIWin32.RECT retval = new XplatUIWin32.RECT (); int hresult = UXTheme.GetThemeBackgroundExtent (hTheme, dc.GetHdc (), iPartId, iStateId, ref BoundsRect, ref retval); dc.ReleaseHdc (); result = retval.ToRectangle (); return hresult; }
public extern static Int32 GetThemeBackgroundExtent(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, ref XplatUIWin32.RECT pClipRect);
public extern static Int32 GetThemeBackgroundRegion(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, out IntPtr pRegion);
public extern static Int32 GetThemeMargins(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, int iPropId, out XplatUIWin32.RECT prc, out MARGINS pMargins);