From 6a3131d03c552cabeb43b4eccc21110fa9cdc454 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sun, 14 Apr 2019 00:21:07 +0200 Subject: [PATCH] vkvg enabled --- Crow/Crow.csproj | 3 +- Crow/src/BmpPicture.cs | 40 +- .../{CairoHelpers.cs => DrawingHelpers.cs} | 23 +- Crow/src/ExtensionsMethods.cs | 227 +- Crow/src/Fill/Fill.cs | 2 +- Crow/src/Font.cs | 2 +- Crow/src/Gradient.cs | 44 +- Crow/src/GraphicObjects/Border.cs | 14 +- Crow/src/GraphicObjects/Button.cs | 2 +- Crow/src/GraphicObjects/DockStack.cs | 11 +- Crow/src/GraphicObjects/GraduatedSlider.cs | 2 +- Crow/src/GraphicObjects/Group.cs | 6 +- Crow/src/GraphicObjects/HueSelector.cs | 6 +- Crow/src/GraphicObjects/Image.cs | 4 +- Crow/src/GraphicObjects/Label.cs | 26 +- Crow/src/GraphicObjects/PrivateContainer.cs | 4 +- Crow/src/GraphicObjects/ProgressBar.cs | 4 +- .../GraphicObjects/SaturationValueSelector.cs | 8 +- Crow/src/GraphicObjects/Scroller.cs | 6 +- Crow/src/GraphicObjects/ScrollingObject.cs | 2 +- Crow/src/GraphicObjects/Shape.cs | 34 +- Crow/src/GraphicObjects/Slider.cs | 4 +- Crow/src/GraphicObjects/Splitter.cs | 8 +- Crow/src/GraphicObjects/TabItem.cs | 48 +- Crow/src/GraphicObjects/TabView.cs | 6 +- Crow/src/GraphicObjects/TemplatedControl.cs | 4 +- Crow/src/GraphicObjects/TestCairoPatch.cs | 134 +- Crow/src/GraphicObjects/TextBox.cs | 2 +- Crow/src/GraphicObjects/TextRun.cs | 18 +- Crow/src/GraphicObjects/Trend.cs | 58 +- Crow/src/GraphicObjects/Widget.cs | 42 +- Crow/src/GraphicObjects/Window.cs | 68 +- Crow/src/Interface.cs | 129 +- Crow/src/Mono.Cairo/Antialias.cs | 43 - Crow/src/Mono.Cairo/Cairo.cs | 53 - Crow/src/Mono.Cairo/CairoDebug.cs | 82 - Crow/src/Mono.Cairo/Content.cs | 43 - Crow/src/Mono.Cairo/Context.cs | 896 ------ Crow/src/Mono.Cairo/DRMDevice.cs | 53 - Crow/src/Mono.Cairo/DRMSurface.cs | 53 - Crow/src/Mono.Cairo/Device.cs | 101 - Crow/src/Mono.Cairo/DirectFBSurface.cs | 43 - Crow/src/Mono.Cairo/Distance.cs | 58 - Crow/src/Mono.Cairo/EGLDevice.cs | 41 - Crow/src/Mono.Cairo/Extend.cs | 45 - Crow/src/Mono.Cairo/FillRule.cs | 41 - Crow/src/Mono.Cairo/Filter.cs | 45 - Crow/src/Mono.Cairo/FontFace.cs | 108 - Crow/src/Mono.Cairo/FontOptions.cs | 143 - Crow/src/Mono.Cairo/FontSlant.cs | 42 - Crow/src/Mono.Cairo/FontType.cs | 41 - Crow/src/Mono.Cairo/FontWeight.cs | 41 - Crow/src/Mono.Cairo/Format.cs | 48 - Crow/src/Mono.Cairo/GLSurface.cs | 61 - Crow/src/Mono.Cairo/GLXDevice.cs | 49 - Crow/src/Mono.Cairo/GlitzSurface.cs | 43 - Crow/src/Mono.Cairo/Glyph.cs | 96 - Crow/src/Mono.Cairo/Gradient.cs | 66 - Crow/src/Mono.Cairo/HintMetrics.cs | 41 - Crow/src/Mono.Cairo/HintStyle.cs | 43 - Crow/src/Mono.Cairo/ImageSurface.cs | 104 - Crow/src/Mono.Cairo/LineCap.cs | 41 - Crow/src/Mono.Cairo/LineJoin.cs | 42 - Crow/src/Mono.Cairo/LinearGradient.cs | 59 - Crow/src/Mono.Cairo/Matrix.cs | 193 -- Crow/src/Mono.Cairo/MeshPattern.cs | 98 - Crow/src/Mono.Cairo/NativeMethods-internal.cs | 1026 ------- Crow/src/Mono.Cairo/NativeMethods.cs | 1065 ------- Crow/src/Mono.Cairo/Operator.cs | 62 - Crow/src/Mono.Cairo/PSSurface.cs | 64 - Crow/src/Mono.Cairo/Path.cs | 73 - Crow/src/Mono.Cairo/Pattern.cs | 155 - Crow/src/Mono.Cairo/PatternType.cs | 44 - Crow/src/Mono.Cairo/PdfSurface.cs | 50 - Crow/src/Mono.Cairo/Point.cs | 57 - Crow/src/Mono.Cairo/RadialGradient.cs | 46 - Crow/src/Mono.Cairo/Region.cs | 196 -- Crow/src/Mono.Cairo/ScaledFont.cs | 123 - Crow/src/Mono.Cairo/SolidPattern.cs | 72 - Crow/src/Mono.Cairo/Status.cs | 64 - Crow/src/Mono.Cairo/SubpixelOrder.cs | 42 - Crow/src/Mono.Cairo/Surface.cs | 233 -- Crow/src/Mono.Cairo/SurfacePattern.cs | 57 - Crow/src/Mono.Cairo/SurfaceType.cs | 61 - Crow/src/Mono.Cairo/SvgSurface.cs | 50 - Crow/src/Mono.Cairo/SvgVersion.cs | 41 - Crow/src/Mono.Cairo/WGLDevice.cs | 45 - Crow/src/Mono.Cairo/Win32Surface.cs | 44 - Crow/src/Mono.Cairo/XcbSurface.cs | 53 - Crow/src/Mono.Cairo/XlibSurface.cs | 95 - Crow/src/MouseCursorChangedEventArgs.cs | 16 +- Crow/src/Picture.cs | 2 +- Crow/src/Point.cs | 20 +- Crow/src/Rectangle.cs | 3 - Crow/src/Rectangles.cs | 2 +- Crow/src/SolidColor.cs | 4 +- Crow/src/SvgPicture.cs | 20 +- Crow/src/backends/IBackend.cs | 62 - Crow/src/backends/IKeyboard.cs | 47 - Crow/src/backends/win32/User32/Cursor.cs | 170 -- .../win32/User32/Delegates/TimerProc.cs | 25 - .../win32/User32/Delegates/WindowProc.cs | 31 - Crow/src/backends/win32/User32/Device.cs | 61 - .../backends/win32/User32/DeviceContext.cs | 213 -- .../Enums/ChangeDisplaySettingsResult.cs | 53 - .../backends/win32/User32/Enums/CursorName.cs | 88 - .../win32/User32/Enums/DeviceBroadcastType.cs | 43 - .../User32/Enums/DeviceModeFieldFlags.cs | 165 -- .../win32/User32/Enums/DeviceNotification.cs | 28 - .../User32/Enums/DisplayDeviceStateFlags.cs | 48 - .../User32/Enums/DisplayFixedOutputType.cs | 19 - .../win32/User32/Enums/DisplayFlags.cs | 21 - .../win32/User32/Enums/DisplayModeSetting.cs | 20 - .../win32/User32/Enums/DisplayOrientation.cs | 29 - .../User32/Enums/DisplaySettingsChanges.cs | 76 - .../win32/User32/Enums/EnumDisplayModes.cs | 24 - .../User32/Enums/ExtendedWindowStyles.cs | 193 -- .../Enums/GetMouseMovePointsResolution.cs | 21 - .../User32/Enums/GetRawInputDataCommand.cs | 19 - .../User32/Enums/GetRawInputDeviceInfoEnum.cs | 25 - .../win32/User32/Enums/GetWindowLongIndex.cs | 50 - .../backends/win32/User32/Enums/IconName.cs | 38 - .../win32/User32/Enums/MapVirtualKeyType.cs | 39 - .../User32/Enums/MonitorFromDefaultValue.cs | 26 - .../win32/User32/Enums/PeekMessageActions.cs | 48 - .../win32/User32/Enums/PrinterColor.cs | 18 - .../User32/Enums/PrinterDefaultSource.cs | 84 - .../win32/User32/Enums/PrinterDitherType.cs | 66 - .../win32/User32/Enums/PrinterDuplex.cs | 23 - .../win32/User32/Enums/PrinterIcmIntent.cs | 38 - .../win32/User32/Enums/PrinterIcmMethod.cs | 33 - .../win32/User32/Enums/PrinterMediaType.cs | 28 - .../win32/User32/Enums/PrinterNupHandling.cs | 18 - .../User32/Enums/PrinterPaperOrientation.cs | 18 - .../win32/User32/Enums/PrinterPaperSize.cs | 600 ---- .../win32/User32/Enums/PrinterPrintQuality.cs | 29 - .../User32/Enums/PrinterTrueTypeOption.cs | 28 - .../win32/User32/Enums/QueueMessageTypes.cs | 96 - .../win32/User32/Enums/RawInputDeviceFlags.cs | 75 - .../win32/User32/Enums/RawInputDeviceType.cs | 23 - .../User32/Enums/RawKeyboardScanCodeFlags.cs | 38 - .../win32/User32/Enums/RawMouseButtonFlags.cs | 101 - .../win32/User32/Enums/RawMouseFlags.cs | 31 - .../win32/User32/Enums/SetWindowPosFlags.cs | 98 - .../User32/Enums/SetWindowPosHwndEnum.cs | 32 - .../win32/User32/Enums/ShowWindowCommand.cs | 83 - .../win32/User32/Enums/TrackMouseEvents.cs | 51 - .../backends/win32/User32/Enums/VirtualKey.cs | 874 ------ .../win32/User32/Enums/WindowClassStyles.cs | 97 - .../win32/User32/Enums/WindowMessage.cs | 1661 ----------- .../User32/Enums/WindowMessageSizeType.cs | 34 - .../win32/User32/Enums/WindowStyles.cs | 179 -- Crow/src/backends/win32/User32/Icon.cs | 159 - Crow/src/backends/win32/User32/Keyboard.cs | 93 - Crow/src/backends/win32/User32/Message.cs | 307 -- Crow/src/backends/win32/User32/Monitor.cs | 70 - Crow/src/backends/win32/User32/Mouse.cs | 133 - Crow/src/backends/win32/User32/RawInput.cs | 423 --- .../Structs/BroadcastDeviceInterface.cs | 58 - .../win32/User32/Structs/CreateStruct.cs | 92 - .../win32/User32/Structs/DeviceMode.cs | 334 --- .../win32/User32/Structs/DisplayDevice.cs | 55 - .../User32/Structs/ExtendedWindowClass.cs | 98 - .../backends/win32/User32/Structs/IconInfo.cs | 49 - .../win32/User32/Structs/MonitorInfo.cs | 42 - .../win32/User32/Structs/MouseMovePoint.cs | 36 - Crow/src/backends/win32/User32/Structs/Msg.cs | 50 - .../backends/win32/User32/Structs/Point.cs | 49 - .../backends/win32/User32/Structs/RawHid.cs | 66 - .../backends/win32/User32/Structs/RawInput.cs | 26 - .../win32/User32/Structs/RawInputData.cs | 34 - .../win32/User32/Structs/RawInputDevice.cs | 83 - .../User32/Structs/RawInputDeviceInfo.cs | 49 - .../User32/Structs/RawInputDeviceInfoHid.cs | 33 - .../Structs/RawInputDeviceInfoKeyboard.cs | 41 - .../User32/Structs/RawInputDeviceInfoMouse.cs | 34 - .../User32/Structs/RawInputDeviceList.cs | 29 - .../win32/User32/Structs/RawInputHeader.cs | 37 - .../win32/User32/Structs/RawKeyboard.cs | 39 - .../backends/win32/User32/Structs/RawMouse.cs | 67 - .../src/backends/win32/User32/Structs/Rect.cs | 102 - .../win32/User32/Structs/StyleStruct.cs | 19 - .../win32/User32/Structs/TrackMouseEvent.cs | 44 - .../win32/User32/Structs/WindowClass.cs | 78 - .../win32/User32/Structs/WindowInfo.cs | 66 - .../win32/User32/Structs/WindowPosition.cs | 49 - Crow/src/backends/win32/User32/Timer.cs | 88 - Crow/src/backends/win32/User32/User32.cs | 13 - Crow/src/backends/win32/User32/Window.cs | 969 ------ Crow/src/backends/win32/User32/WindowClass.cs | 210 -- Crow/src/backends/win32/WinBackend.cs | 478 --- Crow/src/backends/xcb/XCBBackend.cs | 528 ---- Crow/src/backends/xcb/XCBKeyboard.cs | 2605 ----------------- Crow/src/backends/xcb/XCursor.cs | 151 - Crow/src/backends/xlib/X11Keyboard.cs | 120 - Crow/src/backends/xlib/X11Structs.cs | 1821 ------------ Crow/src/backends/xlib/XKeySym.cs | 2109 ------------- Crow/src/backends/xlib/XLibBackend.cs | 255 -- Crow/src/debug/DbgEventTypeColors.cs | 2 +- Crow/src/debug/DbgLogViewer.cs | 2 +- Crow/src/debug/DebugLogger.cs | 2 +- Crow/src/rsvg/Handle.cs | 6 +- Crow/src/vkvg/Context.cs | 262 ++ Crow/src/vkvg/Device.cs | 77 + Crow/src/vkvg/Enums.cs | 139 + Crow/src/{Mono.Cairo => vkvg}/FontExtents.cs | 24 +- Crow/src/vkvg/Matrix.cs | 113 + Crow/src/vkvg/NativeMethods.cs | 266 ++ Crow/src/vkvg/Pattern.cs | 97 + Crow/src/vkvg/Point.cs | 180 ++ Crow/src/{Mono.Cairo => vkvg}/PointD.cs | 4 +- Crow/src/vkvg/Surface.cs | 105 + Crow/src/{Mono.Cairo => vkvg}/TextExtents.cs | 26 +- 213 files changed, 1805 insertions(+), 25761 deletions(-) rename Crow/src/Cairo/{CairoHelpers.cs => DrawingHelpers.cs} (83%) delete mode 100644 Crow/src/Mono.Cairo/Antialias.cs delete mode 100644 Crow/src/Mono.Cairo/Cairo.cs delete mode 100644 Crow/src/Mono.Cairo/CairoDebug.cs delete mode 100644 Crow/src/Mono.Cairo/Content.cs delete mode 100644 Crow/src/Mono.Cairo/Context.cs delete mode 100644 Crow/src/Mono.Cairo/DRMDevice.cs delete mode 100644 Crow/src/Mono.Cairo/DRMSurface.cs delete mode 100644 Crow/src/Mono.Cairo/Device.cs delete mode 100644 Crow/src/Mono.Cairo/DirectFBSurface.cs delete mode 100644 Crow/src/Mono.Cairo/Distance.cs delete mode 100644 Crow/src/Mono.Cairo/EGLDevice.cs delete mode 100644 Crow/src/Mono.Cairo/Extend.cs delete mode 100644 Crow/src/Mono.Cairo/FillRule.cs delete mode 100644 Crow/src/Mono.Cairo/Filter.cs delete mode 100644 Crow/src/Mono.Cairo/FontFace.cs delete mode 100644 Crow/src/Mono.Cairo/FontOptions.cs delete mode 100644 Crow/src/Mono.Cairo/FontSlant.cs delete mode 100644 Crow/src/Mono.Cairo/FontType.cs delete mode 100644 Crow/src/Mono.Cairo/FontWeight.cs delete mode 100644 Crow/src/Mono.Cairo/Format.cs delete mode 100644 Crow/src/Mono.Cairo/GLSurface.cs delete mode 100644 Crow/src/Mono.Cairo/GLXDevice.cs delete mode 100644 Crow/src/Mono.Cairo/GlitzSurface.cs delete mode 100644 Crow/src/Mono.Cairo/Glyph.cs delete mode 100644 Crow/src/Mono.Cairo/Gradient.cs delete mode 100644 Crow/src/Mono.Cairo/HintMetrics.cs delete mode 100644 Crow/src/Mono.Cairo/HintStyle.cs delete mode 100644 Crow/src/Mono.Cairo/ImageSurface.cs delete mode 100644 Crow/src/Mono.Cairo/LineCap.cs delete mode 100644 Crow/src/Mono.Cairo/LineJoin.cs delete mode 100644 Crow/src/Mono.Cairo/LinearGradient.cs delete mode 100644 Crow/src/Mono.Cairo/Matrix.cs delete mode 100644 Crow/src/Mono.Cairo/MeshPattern.cs delete mode 100644 Crow/src/Mono.Cairo/NativeMethods-internal.cs delete mode 100644 Crow/src/Mono.Cairo/NativeMethods.cs delete mode 100644 Crow/src/Mono.Cairo/Operator.cs delete mode 100644 Crow/src/Mono.Cairo/PSSurface.cs delete mode 100644 Crow/src/Mono.Cairo/Path.cs delete mode 100644 Crow/src/Mono.Cairo/Pattern.cs delete mode 100644 Crow/src/Mono.Cairo/PatternType.cs delete mode 100644 Crow/src/Mono.Cairo/PdfSurface.cs delete mode 100644 Crow/src/Mono.Cairo/Point.cs delete mode 100644 Crow/src/Mono.Cairo/RadialGradient.cs delete mode 100644 Crow/src/Mono.Cairo/Region.cs delete mode 100644 Crow/src/Mono.Cairo/ScaledFont.cs delete mode 100644 Crow/src/Mono.Cairo/SolidPattern.cs delete mode 100644 Crow/src/Mono.Cairo/Status.cs delete mode 100644 Crow/src/Mono.Cairo/SubpixelOrder.cs delete mode 100644 Crow/src/Mono.Cairo/Surface.cs delete mode 100644 Crow/src/Mono.Cairo/SurfacePattern.cs delete mode 100644 Crow/src/Mono.Cairo/SurfaceType.cs delete mode 100644 Crow/src/Mono.Cairo/SvgSurface.cs delete mode 100644 Crow/src/Mono.Cairo/SvgVersion.cs delete mode 100644 Crow/src/Mono.Cairo/WGLDevice.cs delete mode 100644 Crow/src/Mono.Cairo/Win32Surface.cs delete mode 100644 Crow/src/Mono.Cairo/XcbSurface.cs delete mode 100644 Crow/src/Mono.Cairo/XlibSurface.cs delete mode 100644 Crow/src/backends/IBackend.cs delete mode 100644 Crow/src/backends/IKeyboard.cs delete mode 100644 Crow/src/backends/win32/User32/Cursor.cs delete mode 100644 Crow/src/backends/win32/User32/Delegates/TimerProc.cs delete mode 100644 Crow/src/backends/win32/User32/Delegates/WindowProc.cs delete mode 100644 Crow/src/backends/win32/User32/Device.cs delete mode 100644 Crow/src/backends/win32/User32/DeviceContext.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/CursorName.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DeviceNotification.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DisplayFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/IconName.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterColor.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/VirtualKey.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/WindowMessage.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs delete mode 100644 Crow/src/backends/win32/User32/Enums/WindowStyles.cs delete mode 100644 Crow/src/backends/win32/User32/Icon.cs delete mode 100644 Crow/src/backends/win32/User32/Keyboard.cs delete mode 100644 Crow/src/backends/win32/User32/Message.cs delete mode 100644 Crow/src/backends/win32/User32/Monitor.cs delete mode 100644 Crow/src/backends/win32/User32/Mouse.cs delete mode 100644 Crow/src/backends/win32/User32/RawInput.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/CreateStruct.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/DeviceMode.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/DisplayDevice.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/IconInfo.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/MonitorInfo.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/Msg.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/Point.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawHid.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInput.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputData.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputDevice.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawInputHeader.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawKeyboard.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/RawMouse.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/Rect.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/StyleStruct.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/WindowClass.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/WindowInfo.cs delete mode 100644 Crow/src/backends/win32/User32/Structs/WindowPosition.cs delete mode 100644 Crow/src/backends/win32/User32/Timer.cs delete mode 100644 Crow/src/backends/win32/User32/User32.cs delete mode 100644 Crow/src/backends/win32/User32/Window.cs delete mode 100644 Crow/src/backends/win32/User32/WindowClass.cs delete mode 100644 Crow/src/backends/win32/WinBackend.cs delete mode 100644 Crow/src/backends/xcb/XCBBackend.cs delete mode 100644 Crow/src/backends/xcb/XCBKeyboard.cs delete mode 100644 Crow/src/backends/xcb/XCursor.cs delete mode 100644 Crow/src/backends/xlib/X11Keyboard.cs delete mode 100644 Crow/src/backends/xlib/X11Structs.cs delete mode 100644 Crow/src/backends/xlib/XKeySym.cs delete mode 100644 Crow/src/backends/xlib/XLibBackend.cs create mode 100644 Crow/src/vkvg/Context.cs create mode 100644 Crow/src/vkvg/Device.cs create mode 100644 Crow/src/vkvg/Enums.cs rename Crow/src/{Mono.Cairo => vkvg}/FontExtents.cs (88%) create mode 100644 Crow/src/vkvg/Matrix.cs create mode 100644 Crow/src/vkvg/NativeMethods.cs create mode 100644 Crow/src/vkvg/Pattern.cs create mode 100644 Crow/src/vkvg/Point.cs rename Crow/src/{Mono.Cairo => vkvg}/PointD.cs (97%) create mode 100644 Crow/src/vkvg/Surface.cs rename Crow/src/{Mono.Cairo => vkvg}/TextExtents.cs (89%) diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj index cb2902f8..8b4a6f7f 100644 --- a/Crow/Crow.csproj +++ b/Crow/Crow.csproj @@ -44,7 +44,7 @@ $(SolutionDir)build\Release - + @@ -76,6 +76,7 @@ + diff --git a/Crow/src/BmpPicture.cs b/Crow/src/BmpPicture.cs index 540087dc..76cd3439 100644 --- a/Crow/src/BmpPicture.cs +++ b/Crow/src/BmpPicture.cs @@ -26,7 +26,7 @@ using System; using System.IO; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -109,20 +109,20 @@ namespace Crow widthRatio = heightRatio; } - using (ImageSurface tmp = new ImageSurface (Format.Argb32, bounds.Width, bounds.Height)) { - using (Context gr = new Context (tmp)) { - gr.Translate (bounds.Left, bounds.Top); - gr.Scale (widthRatio, heightRatio); - gr.Translate ((bounds.Width/widthRatio - Dimensions.Width)/2, (bounds.Height/heightRatio - Dimensions.Height)/2); - - using (ImageSurface imgSurf = new ImageSurface (image, Format.Argb32, - Dimensions.Width, Dimensions.Height, 4 * Dimensions.Width)) { - gr.SetSourceSurface (imgSurf, 0,0); - gr.Paint (); - } - } - ctx.SetSource (tmp); - } + //using (ImageSurface tmp = new ImageSurface (Format.Argb32, bounds.Width, bounds.Height)) { + // using (Context gr = new Context (tmp)) { + // gr.Translate (bounds.Left, bounds.Top); + // gr.Scale (widthRatio, heightRatio); + // gr.Translate ((bounds.Width/widthRatio - Dimensions.Width)/2, (bounds.Height/heightRatio - Dimensions.Height)/2); + + // using (ImageSurface imgSurf = new ImageSurface (image, Format.Argb32, + // Dimensions.Width, Dimensions.Height, 4 * Dimensions.Width)) { + // gr.SetSourceSurface (imgSurf, 0,0); + // gr.Paint (); + // } + // } + // ctx.SetSource (tmp); + //} } #endregion @@ -156,11 +156,11 @@ namespace Crow gr.Scale (widthRatio, heightRatio); gr.Translate ((rect.Width/widthRatio - Dimensions.Width)/2, (rect.Height/heightRatio - Dimensions.Height)/2); - using (ImageSurface imgSurf = new ImageSurface (image, Format.Argb32, - Dimensions.Width, Dimensions.Height, 4 * Dimensions.Width)) { - gr.SetSourceSurface (imgSurf, 0,0); - gr.Paint (); - } + //using (Surface imgSurf = new Surface (. image, Format.Argb32, + // Dimensions.Width, Dimensions.Height, 4 * Dimensions.Width)) { + // gr.SetSourceSurface (imgSurf, 0,0); + // gr.Paint (); + //} gr.Restore (); } } diff --git a/Crow/src/Cairo/CairoHelpers.cs b/Crow/src/Cairo/DrawingHelpers.cs similarity index 83% rename from Crow/src/Cairo/CairoHelpers.cs rename to Crow/src/Cairo/DrawingHelpers.cs index c9b057aa..8fe7f62a 100644 --- a/Crow/src/Cairo/CairoHelpers.cs +++ b/Crow/src/Cairo/DrawingHelpers.cs @@ -25,13 +25,10 @@ // THE SOFTWARE. using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using vkvg; -namespace Crow -{ - public static class CairoHelpers +namespace Crow { + public static class DrawingHelpers { public static T Clamp(this T val, T min, T max) where T : IComparable { @@ -57,18 +54,18 @@ namespace Crow return arr[minp]; } - public static void CairoRectangle(Crow.Cairo.Context gr, Rectangle r, double radius, double stroke = 0.0) + public static void CairoRectangle(Context gr, Rectangle r, double radius, double stroke = 0.0) { if (radius > 0) - CairoHelpers.DrawRoundedRectangle (gr, r, radius, stroke); + DrawRoundedRectangle (gr, r, radius, stroke); else gr.Rectangle (r, stroke); } - public static void CairoCircle(Crow.Cairo.Context gr, Rectangle r) + public static void CairoCircle(Context gr, Rectangle r) { gr.Arc(r.X + r.Width/2, r.Y + r.Height/2, Math.Min(r.Width,r.Height)/2, 0, 2*Math.PI); } - public static void DrawRoundedRectangle(Crow.Cairo.Context gr, Rectangle r, double radius, double stroke = 0.0) + public static void DrawRoundedRectangle(Context gr, Rectangle r, double radius, double stroke = 0.0) { if (stroke>0.0) { gr.LineWidth = stroke; @@ -78,7 +75,7 @@ namespace Crow }else DrawRoundedRectangle(gr, r.X, r.Y, r.Width, r.Height, radius); } - public static void DrawRoundedRectangle(Crow.Cairo.Context gr, double x, double y, double width, double height, double radius) + public static void DrawRoundedRectangle(Context gr, double x, double y, double width, double height, double radius) { gr.Save(); @@ -96,7 +93,7 @@ namespace Crow gr.ClosePath(); gr.Restore(); } - public static void StrokeRaisedRectangle(Crow.Cairo.Context gr, Rectangle r, double width = 1) + public static void StrokeRaisedRectangle(Context gr, Rectangle r, double width = 1) { gr.Save(); r.Inflate((int)-width / 2, (int)-width / 2); @@ -115,7 +112,7 @@ namespace Crow gr.Restore(); } - public static void StrokeLoweredRectangle(Crow.Cairo.Context gr, Rectangle r, double width = 1) + public static void StrokeLoweredRectangle(Context gr, Rectangle r, double width = 1) { gr.Save(); r.Inflate((int)-width / 2, (int)-width / 2); diff --git a/Crow/src/ExtensionsMethods.cs b/Crow/src/ExtensionsMethods.cs index da92fc9f..ec975950 100644 --- a/Crow/src/ExtensionsMethods.cs +++ b/Crow/src/ExtensionsMethods.cs @@ -26,6 +26,7 @@ using System; using System.Linq.Expressions; +using vkvg; namespace Crow { @@ -33,7 +34,7 @@ namespace Crow { #region Cairo extensions - public static void Rectangle(this Crow.Cairo.Context ctx, Rectangle r, double stroke = 0.0) + public static void Rectangle(this Context ctx, Rectangle r, double stroke = 0.0) { if (stroke > 0.0) { ctx.LineWidth = stroke; @@ -43,122 +44,126 @@ namespace Crow }else ctx.Rectangle (r.X, r.Y, r.Width, r.Height); } - public static double GetLength(this Crow.Cairo.PointD p){ + public static double GetLength(this Point p){ return Math.Sqrt (Math.Pow (p.X, 2) + Math.Pow (p.Y, 2)); } - public static Crow.Cairo.PointD GetPerp(this Crow.Cairo.PointD p){ - return new Crow.Cairo.PointD(-p.Y, p.X); - } - public static Crow.Cairo.PointD GetNormalized(this Crow.Cairo.PointD p){ - double length = p.GetLength(); - p.X /= length; - p.Y /= length; - return p; - } - public static Crow.Cairo.PointD Substract(this Crow.Cairo.PointD p1, Crow.Cairo.PointD p2){ - return new Crow.Cairo.PointD(p1.X - p2.X, p1.Y - p2.Y); - } - public static Crow.Cairo.PointD Divide(this Crow.Cairo.PointD p1, double d){ - return new Crow.Cairo.PointD(p1.X / d, p1.Y / d); - } - public static Crow.Cairo.PointD Add(this Crow.Cairo.PointD p1, Crow.Cairo.PointD p2){ - return new Crow.Cairo.PointD(p1.X + p2.X, p1.Y + p2.Y); - } - public static Crow.Cairo.PointD Multiply(this Crow.Cairo.PointD p1, double v){ - return new Crow.Cairo.PointD(p1.X * v, p1.Y * v); - } - public static void DrawCote(this Crow.Cairo.Context ctx, Crow.Cairo.PointD p1, Crow.Cairo.PointD p2, - double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0) - { - Crow.Cairo.PointD vDir = p2.Substract(p1); - vDir = vDir.GetNormalized (); - Crow.Cairo.PointD vPerp = vDir.GetPerp (); - - Crow.Cairo.PointD pA0 = p1.Add(vDir.Multiply(arrowLength)); - Crow.Cairo.PointD pA1 = p2.Substract(vDir.Multiply(arrowLength)); - - Crow.Cairo.PointD vA = vPerp.Multiply (arrowWidth); - - ctx.MoveTo (p1); - ctx.LineTo (pA0.Add (vA)); - if (fill) - ctx.LineTo (pA0.Substract (vA)); - else - ctx.MoveTo (pA0.Substract (vA)); + public static Point GetPerp(this Point p){ + return new Point(-p.Y, p.X); + } + //public static Point GetNormalized(this Point p){ + // double length = p.GetLength(); + // p.X /= length; + // p.Y /= length; + // return p; + //} + //public static Point Substract(this Point p1, Point p2){ + // return new Point(p1.X - p2.X, p1.Y - p2.Y); + //} + //public static Point Divide(this Point p1, double d){ + // return new Point(p1.X / d, p1.Y / d); + //} + //public static Point Add(this Point p1, Point p2){ + // return new Point(p1.X + p2.X, p1.Y + p2.Y); + //} + //public static Point Multiply(this Point p1, double v){ + // return new Point(p1.X * v, p1.Y * v); + //} + //public static void DrawCote(this Context ctx, Point p1, Point p2, + // double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0) + //{ + // Point vDir = p2.Substract(p1); + // vDir = vDir.GetNormalized (); + // Point vPerp = vDir.GetPerp (); + + // Point pA0 = p1.Add(vDir.Multiply(arrowLength)); + // Point pA1 = p2.Substract(vDir.Multiply(arrowLength)); + + // Point vA = vPerp.Multiply (arrowWidth); + + // ctx.MoveTo (p1); + // ctx.LineTo (pA0.Add (vA)); + // if (fill) + // ctx.LineTo (pA0.Substract (vA)); + // else + // ctx.MoveTo (pA0.Substract (vA)); - ctx.LineTo (p1); - - ctx.MoveTo (p2); - ctx.LineTo (pA1.Add (vA)); - if (fill) - ctx.LineTo (pA1.Substract (vA)); - else - ctx.MoveTo (pA1.Substract (vA)); - ctx.LineTo (p2); - - if (fill) - ctx.Fill (); - - ctx.MoveTo (p1); - ctx.LineTo (p2); - ctx.LineWidth = stroke; - ctx.Stroke (); - } - public static void DrawCoteInverse(this Crow.Cairo.Context ctx, Crow.Cairo.PointD p1, Crow.Cairo.PointD p2, - double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0) - { - Crow.Cairo.PointD vDir = p2.Substract(p1); - vDir = vDir.GetNormalized (); - Crow.Cairo.PointD vPerp = vDir.GetPerp (); - - Crow.Cairo.PointD pA0 = p1.Add(vDir.Multiply(arrowLength)); - Crow.Cairo.PointD pA1 = p2.Substract(vDir.Multiply(arrowLength)); - - Crow.Cairo.PointD vA = vPerp.Multiply (arrowWidth); - - ctx.MoveTo (p1.Add (vA)); - ctx.LineTo (pA0); - ctx.LineTo (p1.Substract (vA)); - if (fill) - ctx.LineTo (p1.Add (vA)); - - ctx.MoveTo (p2.Add (vA)); - ctx.LineTo (pA1); - ctx.LineTo (p2.Substract (vA)); - - if (fill) { - ctx.LineTo (p2.Add (vA)); - ctx.Fill (); - } - - ctx.MoveTo (pA0); - ctx.LineTo (pA1); - ctx.LineWidth = stroke; - ctx.Stroke (); - } - public static void DrawCoteFixed(this Crow.Cairo.Context ctx, Crow.Cairo.PointD p1, Crow.Cairo.PointD p2, - double stroke = 1.0, double coteWidth = 3.0) - { - Crow.Cairo.PointD vDir = p2.Substract(p1); - vDir = vDir.GetNormalized (); - Crow.Cairo.PointD vPerp = vDir.GetPerp (); - Crow.Cairo.PointD vA = vPerp.Multiply (coteWidth); - - ctx.MoveTo (p1.Add (vA)); - ctx.LineTo (p1.Substract (vA)); - ctx.MoveTo (p2.Add (vA)); - ctx.LineTo (p2.Substract (vA)); - ctx.MoveTo (p1); - ctx.LineTo (p2); - ctx.LineWidth = stroke; - ctx.Stroke (); + // ctx.LineTo (p1); + + // ctx.MoveTo (p2); + // ctx.LineTo (pA1.Add (vA)); + // if (fill) + // ctx.LineTo (pA1.Substract (vA)); + // else + // ctx.MoveTo (pA1.Substract (vA)); + // ctx.LineTo (p2); + + // if (fill) + // ctx.Fill (); + + // ctx.MoveTo (p1); + // ctx.LineTo (p2); + // ctx.LineWidth = stroke; + // ctx.Stroke (); + //} + //public static void DrawCoteInverse(this Context ctx, Point p1, Point p2, + // double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0) + //{ + // Point vDir = p2.Substract(p1); + // vDir = vDir.GetNormalized (); + // Point vPerp = vDir.GetPerp (); + + // Point pA0 = p1.Add(vDir.Multiply(arrowLength)); + // Point pA1 = p2.Substract(vDir.Multiply(arrowLength)); + + // Point vA = vPerp.Multiply (arrowWidth); + + // ctx.MoveTo (p1.Add (vA)); + // ctx.LineTo (pA0); + // ctx.LineTo (p1.Substract (vA)); + // if (fill) + // ctx.LineTo (p1.Add (vA)); + + // ctx.MoveTo (p2.Add (vA)); + // ctx.LineTo (pA1); + // ctx.LineTo (p2.Substract (vA)); + + // if (fill) { + // ctx.LineTo (p2.Add (vA)); + // ctx.Fill (); + // } + + // ctx.MoveTo (pA0); + // ctx.LineTo (pA1); + // ctx.LineWidth = stroke; + // ctx.Stroke (); + //} + //public static void DrawCoteFixed(this Context ctx, Point p1, Point p2, + // double stroke = 1.0, double coteWidth = 3.0) + //{ + // Point vDir = p2.Substract(p1); + // vDir = vDir.GetNormalized (); + // Point vPerp = vDir.GetPerp (); + // Point vA = vPerp.Multiply (coteWidth); + + // ctx.MoveTo (p1.Add (vA)); + // ctx.LineTo (p1.Substract (vA)); + // ctx.MoveTo (p2.Add (vA)); + // ctx.LineTo (p2.Substract (vA)); + // ctx.MoveTo (p1); + // ctx.LineTo (p2); + // ctx.LineWidth = stroke; + // ctx.Stroke (); + //} + + public static void SetSourceColor(this Context ctx, Color c) + { + ctx.SetSource(c.R,c.G,c.B,c.A); } - - public static void SetSourceColor(this Crow.Cairo.Context ctx, Color c) + public static void SetSourceColor(this Context ctx, double r, double g, double b, double a) { - ctx.SetSourceRGBA(c.R,c.G,c.B,c.A); + ctx.SetSource((float)r,(float)g,(float)g,(float)a); } - public static void AddColorStop(this Crow.Cairo.Gradient grad, double offset, Color c) + public static void AddColorStop(this Gradient grad, double offset, Color c) { grad.AddColorStop (offset, c); } diff --git a/Crow/src/Fill/Fill.cs b/Crow/src/Fill/Fill.cs index 7d521045..e3a1767c 100644 --- a/Crow/src/Fill/Fill.cs +++ b/Crow/src/Fill/Fill.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; -using Crow.Cairo; +using vkvg; namespace Crow { diff --git a/Crow/src/Font.cs b/Crow/src/Font.cs index 06df4a88..16aab074 100644 --- a/Crow/src/Font.cs +++ b/Crow/src/Font.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; namespace Crow { diff --git a/Crow/src/Gradient.cs b/Crow/src/Gradient.cs index 1e37fac3..25f662ed 100644 --- a/Crow/src/Gradient.cs +++ b/Crow/src/Gradient.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -81,29 +81,29 @@ namespace Crow public override void SetAsSource (Context ctx, Rectangle bounds = default(Rectangle)) { - Crow.Cairo.Gradient grad = null; - switch (GradientType) { - case Type.Vertical: - grad = new Crow.Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Left, bounds.Bottom); - break; - case Type.Horizontal: - grad = new Crow.Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Top); - break; - case Type.Oblic: - grad = new Crow.Cairo.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Bottom); - break; - case Type.Radial: - throw new NotImplementedException (); - } + //Gradient grad = null; + //switch (GradientType) { + //case Type.Vertical: + // grad = new LinearGradient (bounds.Left, bounds.Top, bounds.Left, bounds.Bottom); + // break; + //case Type.Horizontal: + // grad = new LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Top); + // break; + //case Type.Oblic: + // grad = new LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Bottom); + // break; + //case Type.Radial: + // throw new NotImplementedException (); + //} - foreach (ColorStop cs in Stops) { - if (cs == null) - continue; - grad.AddColorStop (cs.Offset, cs.Color); - } + //foreach (ColorStop cs in Stops) { + // if (cs == null) + // continue; + // grad.AddColorStop (cs.Offset, cs.Color); + //} - ctx.SetSource (grad); - grad.Dispose (); + //ctx.SetSource (grad); + //grad.Dispose (); } #endregion diff --git a/Crow/src/GraphicObjects/Border.cs b/Crow/src/GraphicObjects/Border.cs index e5a16ec8..142e54b2 100644 --- a/Crow/src/GraphicObjects/Border.cs +++ b/Crow/src/GraphicObjects/Border.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -134,7 +134,7 @@ namespace Crow gr.Save (); if (ClipToClientRect) { //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle,Math.Max(0.0, CornerRadius-Margin)); + DrawingHelpers.CairoRectangle (gr, ClientRectangle,Math.Max(0.0, CornerRadius-Margin)); gr.Clip (); } @@ -150,14 +150,14 @@ namespace Crow // rBack.Inflate (-BorderWidth / 2); Background.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle(gr, rBack, CornerRadius); + DrawingHelpers.CairoRectangle(gr, rBack, CornerRadius); gr.Fill (); if (BorderStyle == BorderStyle.Normal) { if (BorderWidth > 0) { Foreground.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle (gr, rBack, CornerRadius, BorderWidth); + DrawingHelpers.CairoRectangle (gr, rBack, CornerRadius, BorderWidth); } } else { gr.LineWidth = 1.0; @@ -237,7 +237,7 @@ namespace Crow // rBack.Inflate (-BorderWidth / 2); Background.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle(gr, rBack, CornerRadius); + DrawingHelpers.CairoRectangle(gr, rBack, CornerRadius); gr.Fill (); double bw = _borderWidth; @@ -252,7 +252,7 @@ namespace Crow else gr.SetSourceColor (sunkenColor); - CairoHelpers.CairoRectangle (gr, rBack, crad, bw); + DrawingHelpers.CairoRectangle (gr, rBack, crad, bw); if (BorderStyle == BorderStyle.Sunken) gr.SetSourceColor (sunkenColor); @@ -264,7 +264,7 @@ namespace Crow rBack.Height -= (int)Math.Round(bw); } - CairoHelpers.CairoRectangle (gr, rBack, crad, bw); + DrawingHelpers.CairoRectangle (gr, rBack, crad, bw); } } #endregion diff --git a/Crow/src/GraphicObjects/Button.cs b/Crow/src/GraphicObjects/Button.cs index 8b15c2ea..50f98237 100644 --- a/Crow/src/GraphicObjects/Button.cs +++ b/Crow/src/GraphicObjects/Button.cs @@ -33,7 +33,7 @@ using System.Text; using System.Diagnostics; using System.Xml.Serialization; -using Crow.Cairo; +using vkvg; using System.ComponentModel; namespace Crow diff --git a/Crow/src/GraphicObjects/DockStack.cs b/Crow/src/GraphicObjects/DockStack.cs index ab86ae0b..181501cb 100644 --- a/Crow/src/GraphicObjects/DockStack.cs +++ b/Crow/src/GraphicObjects/DockStack.cs @@ -28,6 +28,7 @@ using Crow.IML; using System.Linq; using System.Text; using System.IO; +using vkvg; namespace Crow { @@ -189,19 +190,19 @@ namespace Crow RegisterForGraphicUpdate (); } - protected override void onDraw (Crow.Cairo.Context gr) + protected override void onDraw (Context gr) { gr.Save (); Rectangle rBack = new Rectangle (Slot.Size); Background.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle (gr, rBack, CornerRadius); + DrawingHelpers.CairoRectangle (gr, rBack, CornerRadius); gr.Fill (); if (ClipToClientRect) { //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); + DrawingHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); gr.Clip (); } @@ -248,9 +249,9 @@ namespace Crow break; } gr.LineWidth = 1; - gr.SetSourceRGBA (0.4, 0.4, 0.9, 0.4); + gr.SetSourceColor (0.4, 0.4, 0.9, 0.4); gr.FillPreserve (); - gr.SetSourceRGBA (0.9, 0.9, 1.0, 0.8); + gr.SetSourceColor (0.9, 0.9, 1.0, 0.8); gr.Stroke (); } gr.Restore (); diff --git a/Crow/src/GraphicObjects/GraduatedSlider.cs b/Crow/src/GraphicObjects/GraduatedSlider.cs index 71bbff11..932378ba 100644 --- a/Crow/src/GraphicObjects/GraduatedSlider.cs +++ b/Crow/src/GraphicObjects/GraduatedSlider.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using Crow.Cairo; +using vkvg; using System.Xml.Serialization; namespace Crow diff --git a/Crow/src/GraphicObjects/Group.cs b/Crow/src/GraphicObjects/Group.cs index fdd078ab..b1536c59 100644 --- a/Crow/src/GraphicObjects/Group.cs +++ b/Crow/src/GraphicObjects/Group.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Xml.Serialization; -using Crow.Cairo; +using vkvg; using System.Diagnostics; using System.Reflection; using System.Threading; @@ -292,7 +292,7 @@ namespace Crow if (ClipToClientRect) { //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); + DrawingHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); gr.Clip (); } @@ -317,7 +317,7 @@ namespace Crow base.onDraw (gr); if (ClipToClientRect) { - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); + DrawingHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); gr.Clip (); } diff --git a/Crow/src/GraphicObjects/HueSelector.cs b/Crow/src/GraphicObjects/HueSelector.cs index e9a31dfb..8ef48f1d 100644 --- a/Crow/src/GraphicObjects/HueSelector.cs +++ b/Crow/src/GraphicObjects/HueSelector.cs @@ -27,7 +27,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -91,7 +91,7 @@ namespace Crow grad.Stops.Add (new Gradient.ColorStop (1, new Color (1, 0, 0, 1))); grad.SetAsSource (gr, r); - CairoHelpers.CairoRectangle (gr, r, CornerRadius); + DrawingHelpers.CairoRectangle (gr, r, CornerRadius); gr.Fill(); } @@ -114,7 +114,7 @@ namespace Crow r.Y = mousePos.Y - 2; } - CairoHelpers.CairoRectangle (ctx, r, 1); + DrawingHelpers.CairoRectangle (ctx, r, 1); ctx.SetSourceColor (Color.White); ctx.LineWidth = 1.0; ctx.Stroke(); diff --git a/Crow/src/GraphicObjects/Image.cs b/Crow/src/GraphicObjects/Image.cs index 98f86e58..2791d082 100644 --- a/Crow/src/GraphicObjects/Image.cs +++ b/Crow/src/GraphicObjects/Image.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; @@ -203,7 +203,7 @@ namespace Crow _pic.Paint (gr, ClientRectangle, _svgSub); if (Opacity<1.0) { - gr.SetSourceRGBA (0.0, 0.0, 0.0, 1.0-Opacity); + gr.SetSourceColor (0.0, 0.0, 0.0, 1.0-Opacity); gr.Operator = Operator.DestOut; gr.Rectangle (ClientRectangle); gr.Fill (); diff --git a/Crow/src/GraphicObjects/Label.cs b/Crow/src/GraphicObjects/Label.cs index 371e79ce..9b49731b 100644 --- a/Crow/src/GraphicObjects/Label.cs +++ b/Crow/src/GraphicObjects/Label.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Diagnostics; -using Crow.Cairo; +using vkvg; using System.Text.RegularExpressions; using System.Xml.Serialization; using System.ComponentModel; @@ -447,14 +447,14 @@ namespace Crow if (lines == null) lines = getLines; if (!textMeasureIsUpToDate) { - using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) { + using (Surface img = new Surface (IFace.dev, 10, 10)) { using (Context gr = new Context (img)) { //Cairo.FontFace cf = gr.GetContextFontFace (); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - gr.FontOptions = Interface.FontRenderingOptions; - gr.Antialias = Interface.Antialias; + gr.FontFace = Font.Name; + gr.FontSize = (uint)Font.Size; + //gr.FontOptions = Interface.FontRenderingOptions; + //gr.Antialias = Interface.Antialias; fe = gr.FontExtents; te = new TextExtents (); @@ -485,10 +485,10 @@ namespace Crow { base.onDraw (gr); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - gr.FontOptions = Interface.FontRenderingOptions; - gr.Antialias = Interface.Antialias; + gr.FontFace = Font.Name; + gr.FontSize = (uint)Font.Size; + //gr.FontOptions = Interface.FontRenderingOptions; + //gr.Antialias = Interface.Antialias; rText = new Rectangle(new Size( measureRawSize(LayoutingType.Width), measureRawSize(LayoutingType.Height))); @@ -691,13 +691,13 @@ namespace Crow public override void onMouseEnter (object sender, MouseMoveEventArgs e) { base.onMouseEnter (sender, e); - if (Selectable) - IFace.MouseCursor = MouseCursors.Text; + //if (Selectable) + //IFace.MouseCursor = MouseCursors.Text; } public override void onMouseLeave (object sender, MouseMoveEventArgs e) { base.onMouseLeave (sender, e); - IFace.MouseCursor = MouseCursors.Default; + //IFace.MouseCursor = MouseCursors.Default; } protected override void onFocused (object sender, EventArgs e) { diff --git a/Crow/src/GraphicObjects/PrivateContainer.cs b/Crow/src/GraphicObjects/PrivateContainer.cs index 1f86a034..4d9aff06 100644 --- a/Crow/src/GraphicObjects/PrivateContainer.cs +++ b/Crow/src/GraphicObjects/PrivateContainer.cs @@ -27,7 +27,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -185,7 +185,7 @@ namespace Crow if (ClipToClientRect) { //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); + DrawingHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); gr.Clip (); } diff --git a/Crow/src/GraphicObjects/ProgressBar.cs b/Crow/src/GraphicObjects/ProgressBar.cs index 20fadadc..ee007775 100644 --- a/Crow/src/GraphicObjects/ProgressBar.cs +++ b/Crow/src/GraphicObjects/ProgressBar.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using Crow.Cairo; +using vkvg; using System.Diagnostics; using System.Xml.Serialization; using System.ComponentModel; @@ -60,7 +60,7 @@ namespace Crow rBack.Width = (int)((double)rBack.Width / Maximum * Value); Foreground.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle(gr,rBack,CornerRadius); + DrawingHelpers.CairoRectangle(gr,rBack,CornerRadius); gr.Fill(); } #endregion diff --git a/Crow/src/GraphicObjects/SaturationValueSelector.cs b/Crow/src/GraphicObjects/SaturationValueSelector.cs index 535a90df..fc4f62ed 100644 --- a/Crow/src/GraphicObjects/SaturationValueSelector.cs +++ b/Crow/src/GraphicObjects/SaturationValueSelector.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; using System.Xml.Serialization; namespace Crow @@ -74,7 +74,7 @@ namespace Crow if (Foreground != null) {//TODO:test if null should be removed Foreground.SetAsSource (gr, r); - CairoHelpers.CairoRectangle (gr, r, CornerRadius); + DrawingHelpers.CairoRectangle (gr, r, CornerRadius); gr.Fill (); } @@ -82,13 +82,13 @@ namespace Crow grad.Stops.Add (new Gradient.ColorStop (0, new Color (1, 1, 1, 1))); grad.Stops.Add (new Gradient.ColorStop (1, new Color (1, 1, 1, 0))); grad.SetAsSource (gr, r); - CairoHelpers.CairoRectangle (gr, r, CornerRadius); + DrawingHelpers.CairoRectangle (gr, r, CornerRadius); gr.Fill(); grad = new Gradient (Gradient.Type.Vertical); grad.Stops.Add (new Gradient.ColorStop (0, new Color (0, 0, 0, 0))); grad.Stops.Add (new Gradient.ColorStop (1, new Color (0, 0, 0, 1))); grad.SetAsSource (gr, r); - CairoHelpers.CairoRectangle (gr, r, CornerRadius); + DrawingHelpers.CairoRectangle (gr, r, CornerRadius); gr.Fill(); } diff --git a/Crow/src/GraphicObjects/Scroller.cs b/Crow/src/GraphicObjects/Scroller.cs index b97009ba..4f244f43 100644 --- a/Crow/src/GraphicObjects/Scroller.cs +++ b/Crow/src/GraphicObjects/Scroller.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -201,13 +201,13 @@ namespace Crow Rectangle rBack = new Rectangle (Slot.Size); Background.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle(gr,rBack, CornerRadius); + DrawingHelpers.CairoRectangle(gr,rBack, CornerRadius); gr.Fill (); gr.Save (); if (ClipToClientRect) { //clip to scrolled client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); + DrawingHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); gr.Clip (); } diff --git a/Crow/src/GraphicObjects/ScrollingObject.cs b/Crow/src/GraphicObjects/ScrollingObject.cs index 12804899..edb1aa11 100644 --- a/Crow/src/GraphicObjects/ScrollingObject.cs +++ b/Crow/src/GraphicObjects/ScrollingObject.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Collections; -using Crow.Cairo; +using vkvg; namespace Crow diff --git a/Crow/src/GraphicObjects/Shape.cs b/Crow/src/GraphicObjects/Shape.cs index 99678556..d392c56d 100644 --- a/Crow/src/GraphicObjects/Shape.cs +++ b/Crow/src/GraphicObjects/Shape.cs @@ -28,7 +28,7 @@ using System.Xml.Serialization; using System.ComponentModel; using System.IO; using System.Text; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -172,22 +172,22 @@ namespace Crow } protected override int measureRawSize (LayoutingType lt) { - if ((lt == LayoutingType.Width && contentSize.Width == 0) || (lt == LayoutingType.Height && contentSize.Height == 0)) { - if (size != default(Size)) - contentSize = size; - else - { - using (Surface drawing = new ImageSurface(Format.A1, 1, 1)) - { - using (Context ctx = new Context(drawing)) - { - executePath(ctx); - Rectangle r = ctx.StrokeExtents(); - contentSize = new Size(r.Right, r.Bottom); - } - } - } - } + //if ((lt == LayoutingType.Width && contentSize.Width == 0) || (lt == LayoutingType.Height && contentSize.Height == 0)) { + // if (size != default(Size)) + // contentSize = size; + // else + // { + // using (Surface drawing = new Surface(IFace.dev, 1, 1)) + // { + // using (Context ctx = new Context(drawing)) + // { + // executePath(ctx); + // Rectangle r = ctx.StrokeExtents(); + // contentSize = new Size(r.Right, r.Bottom); + // } + // } + // } + //} return lt == LayoutingType.Width ? contentSize.Width + 2 * Margin: contentSize.Height + 2 * Margin; } diff --git a/Crow/src/GraphicObjects/Slider.cs b/Crow/src/GraphicObjects/Slider.cs index 891e393e..a5887d13 100644 --- a/Crow/src/GraphicObjects/Slider.cs +++ b/Crow/src/GraphicObjects/Slider.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; @@ -166,7 +166,7 @@ namespace Crow } protected virtual void DrawCursor(Context gr, Rectangle _cursor) { - CairoHelpers.CairoRectangle (gr, _cursor, CornerRadius); + DrawingHelpers.CairoRectangle (gr, _cursor, CornerRadius); Foreground.SetAsSource(gr, _cursor); gr.StrokePreserve(); CursorColor.SetAsSource(gr, _cursor); diff --git a/Crow/src/GraphicObjects/Splitter.cs b/Crow/src/GraphicObjects/Splitter.cs index 53515eb8..cc0ba323 100644 --- a/Crow/src/GraphicObjects/Splitter.cs +++ b/Crow/src/GraphicObjects/Splitter.cs @@ -90,10 +90,10 @@ namespace Crow public override void onMouseEnter (object sender, MouseMoveEventArgs e) { base.onMouseEnter (sender, e); - if ((Parent as GenericStack).Orientation == Orientation.Horizontal) - IFace.MouseCursor = MouseCursors.H; - else - IFace.MouseCursor = MouseCursors.V; + //if ((Parent as GenericStack).Orientation == Orientation.Horizontal) + // IFace.MouseCursor = MouseCursors.H; + //else + //IFace.MouseCursor = MouseCursors.V; } public override void onMouseLeave (object sender, MouseMoveEventArgs e) { diff --git a/Crow/src/GraphicObjects/TabItem.cs b/Crow/src/GraphicObjects/TabItem.cs index 113a4399..95c36420 100644 --- a/Crow/src/GraphicObjects/TabItem.cs +++ b/Crow/src/GraphicObjects/TabItem.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; -using Crow.Cairo; +using vkvg; using System.Linq; namespace Crow @@ -192,29 +192,29 @@ namespace Crow void makeFloating (TabView tv) { - lock (IFace.UpdateMutex) { - ImageSurface di = new ImageSurface (Format.Argb32, dis, dis); - IFace.DragImageHeight = dis; - IFace.DragImageWidth = dis; - using (Context ctx = new Context (di)) { - double div = Math.Max (LastPaintedSlot.Width, LastPaintedSlot.Height); - double s = (double)dis / div; - ctx.Scale (s, s); - if (bmp == null) - this.onDraw (ctx); - else { - if (LastPaintedSlot.Width>LastPaintedSlot.Height) - ctx.SetSourceSurface (bmp, 0, (LastPaintedSlot.Width-LastPaintedSlot.Height)/2); - else - ctx.SetSourceSurface (bmp, (LastPaintedSlot.Height-LastPaintedSlot.Width)/2, 0); - - ctx.Paint (); - } - } - IFace.DragImage = di; - } - tv.RemoveChild (this); - savedParent = tv; + //lock (IFace.UpdateMutex) { + // ImageSurface di = new ImageSurface (Format.Argb32, dis, dis); + // IFace.DragImageHeight = dis; + // IFace.DragImageWidth = dis; + // using (Context ctx = new Context (di)) { + // double div = Math.Max (LastPaintedSlot.Width, LastPaintedSlot.Height); + // double s = (double)dis / div; + // ctx.Scale (s, s); + // if (bmp == null) + // this.onDraw (ctx); + // else { + // if (LastPaintedSlot.Width>LastPaintedSlot.Height) + // ctx.SetSourceSurface (bmp, 0, (LastPaintedSlot.Width-LastPaintedSlot.Height)/2); + // else + // ctx.SetSourceSurface (bmp, (LastPaintedSlot.Height-LastPaintedSlot.Width)/2, 0); + + // ctx.Paint (); + // } + // } + // IFace.DragImage = di; + //} + //tv.RemoveChild (this); + //savedParent = tv; } public override ILayoutable Parent { diff --git a/Crow/src/GraphicObjects/TabView.cs b/Crow/src/GraphicObjects/TabView.cs index 550d60aa..9f2a9bad 100644 --- a/Crow/src/GraphicObjects/TabView.cs +++ b/Crow/src/GraphicObjects/TabView.cs @@ -27,7 +27,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; -using Crow.Cairo; +using vkvg; using System.Diagnostics; using System.Linq; @@ -262,14 +262,14 @@ namespace Crow Rectangle rBack = new Rectangle (Slot.Size); Background.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle(gr,rBack, CornerRadius); + DrawingHelpers.CairoRectangle(gr,rBack, CornerRadius); gr.Fill (); gr.Save (); if (ClipToClientRect) { //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); + DrawingHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); gr.Clip (); } diff --git a/Crow/src/GraphicObjects/TemplatedControl.cs b/Crow/src/GraphicObjects/TemplatedControl.cs index d93cf4c8..1fa24a48 100644 --- a/Crow/src/GraphicObjects/TemplatedControl.cs +++ b/Crow/src/GraphicObjects/TemplatedControl.cs @@ -29,7 +29,7 @@ using System.ComponentModel; using System.IO; using System.Xml; using System.Reflection; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -120,7 +120,7 @@ namespace Crow if (ClipToClientRect) { //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); + DrawingHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); gr.Clip (); } diff --git a/Crow/src/GraphicObjects/TestCairoPatch.cs b/Crow/src/GraphicObjects/TestCairoPatch.cs index dcfb584c..51d9aaf2 100644 --- a/Crow/src/GraphicObjects/TestCairoPatch.cs +++ b/Crow/src/GraphicObjects/TestCairoPatch.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -54,94 +54,94 @@ namespace Crow { base.onDraw (gr); - double radius = 100; + //double radius = 100; - double pi3 = Math.PI / 3.0; + //double pi3 = Math.PI / 3.0; - MeshPattern mp = new MeshPattern (); + //MeshPattern mp = new MeshPattern (); - double x1 = radius,y1 = 0, - x2 = 0, y2 = 0, x3 = 0, y3 = 0, x4 = 0, y4 = 0, - xc = radius,yc = radius; + //double x1 = radius,y1 = 0, + //x2 = 0, y2 = 0, x3 = 0, y3 = 0, x4 = 0, y4 = 0, + //xc = radius,yc = radius; - double dx = Math.Sin (pi3) * radius; - double dy = Math.Cos (pi3) * radius; + //double dx = Math.Sin (pi3) * radius; + //double dy = Math.Cos (pi3) * radius; - mp.BeginPatch (); - mp.MoveTo (xc, yc); - mp.LineTo (x1, y1); - x4 = xc + dx; - y4 = yc - dy; - computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); - mp.CurveTo (x2, y2, x3, y3, x4, y4); + //mp.BeginPatch (); + //mp.MoveTo (xc, yc); + //mp.LineTo (x1, y1); + //x4 = xc + dx; + //y4 = yc - dy; + //computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); + //mp.CurveTo (x2, y2, x3, y3, x4, y4); - mp.SetCornerColorRGB (0, 1, 1, 1); - mp.SetCornerColorRGB (1, 1, 0, 0); - mp.SetCornerColorRGB (2, 1, 1, 0); + //mp.SetCornerColorRGB (0, 1, 1, 1); + //mp.SetCornerColorRGB (1, 1, 0, 0); + //mp.SetCornerColorRGB (2, 1, 1, 0); - x1 = x4; - y1 = y4; - y4 = yc + dy; + //x1 = x4; + //y1 = y4; + //y4 = yc + dy; - computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); - mp.CurveTo (x2, y2, x3, y3, x4, y4); + //computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); + //mp.CurveTo (x2, y2, x3, y3, x4, y4); - mp.SetCornerColorRGB (3, 0, 1, 0); - mp.EndPatch (); + //mp.SetCornerColorRGB (3, 0, 1, 0); + //mp.EndPatch (); - x1 = x4; - y1 = y4; - x4 = xc; - y4 = yc * 2.0; + //x1 = x4; + //y1 = y4; + //x4 = xc; + //y4 = yc * 2.0; - mp.BeginPatch (); - mp.MoveTo (xc, yc); - mp.LineTo (x1, y1); - computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); - mp.CurveTo (x2, y2, x3, y3, x4, y4); + //mp.BeginPatch (); + //mp.MoveTo (xc, yc); + //mp.LineTo (x1, y1); + //computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); + //mp.CurveTo (x2, y2, x3, y3, x4, y4); - mp.SetCornerColorRGB (0, 1, 1, 1); - mp.SetCornerColorRGB (1, 0, 1, 0); - mp.SetCornerColorRGB (2, 0, 1, 1); + //mp.SetCornerColorRGB (0, 1, 1, 1); + //mp.SetCornerColorRGB (1, 0, 1, 0); + //mp.SetCornerColorRGB (2, 0, 1, 1); - x1 = x4; - y1 = y4; - x4 = xc-dx; - y4 = yc+dy; + //x1 = x4; + //y1 = y4; + //x4 = xc-dx; + //y4 = yc+dy; - computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); - mp.CurveTo (x2, y2, x3, y3, x4, y4); + //computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); + //mp.CurveTo (x2, y2, x3, y3, x4, y4); - mp.SetCornerColorRGB (3, 0, 0, 1); - mp.EndPatch (); + //mp.SetCornerColorRGB (3, 0, 0, 1); + //mp.EndPatch (); - x1 = x4; - y1 = y4; - y4 = yc - dy; + //x1 = x4; + //y1 = y4; + //y4 = yc - dy; - mp.BeginPatch (); - mp.MoveTo (xc, yc); - mp.LineTo (x1, y1); - computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); - mp.CurveTo (x2, y2, x3, y3, x4, y4); + //mp.BeginPatch (); + //mp.MoveTo (xc, yc); + //mp.LineTo (x1, y1); + //computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); + //mp.CurveTo (x2, y2, x3, y3, x4, y4); - mp.SetCornerColorRGB (0, 1, 1, 1); - mp.SetCornerColorRGB (1, 0, 0, 1); - mp.SetCornerColorRGB (2, 1, 0, 1); + //mp.SetCornerColorRGB (0, 1, 1, 1); + //mp.SetCornerColorRGB (1, 0, 0, 1); + //mp.SetCornerColorRGB (2, 1, 0, 1); - x1 = x4; - y1 = y4; - x4 = radius; - y4 = 0; + //x1 = x4; + //y1 = y4; + //x4 = radius; + //y4 = 0; - computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); - mp.CurveTo (x2, y2, x3, y3, x4, y4); + //computeControlPoints (xc, yc, x1, y1, out x2, out y2, out x3, out y3, x4, y4); + //mp.CurveTo (x2, y2, x3, y3, x4, y4); - mp.SetCornerColorRGB (3, 1, 0, 0); - mp.EndPatch (); + //mp.SetCornerColorRGB (3, 1, 0, 0); + //mp.EndPatch (); - gr.SetSource (mp); - gr.Paint (); + //gr.SetSource (mp); + //gr.Paint (); } } } diff --git a/Crow/src/GraphicObjects/TextBox.cs b/Crow/src/GraphicObjects/TextBox.cs index 71fd6205..a37d9f67 100644 --- a/Crow/src/GraphicObjects/TextBox.cs +++ b/Crow/src/GraphicObjects/TextBox.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; using System.Diagnostics; using System.Xml.Serialization; diff --git a/Crow/src/GraphicObjects/TextRun.cs b/Crow/src/GraphicObjects/TextRun.cs index 8b20ddb7..7e09fd08 100644 --- a/Crow/src/GraphicObjects/TextRun.cs +++ b/Crow/src/GraphicObjects/TextRun.cs @@ -29,7 +29,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; -using Crow.Cairo; +using vkvg; using System.Text.RegularExpressions; using System.Xml.Serialization; using System.ComponentModel; @@ -150,12 +150,12 @@ namespace Crow if (lines == null) lines = getLines; - using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) { + using (Surface img = new Surface (IFace.dev, 10, 10)) { using (Context gr = new Context (img)) { //Cairo.FontFace cf = gr.GetContextFontFace (); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); + gr.FontFace = Font.Name; + gr.FontSize = (uint)Font.Size; fe = gr.FontExtents; @@ -184,10 +184,10 @@ namespace Crow { base.onDraw (gr); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - gr.FontOptions = Interface.FontRenderingOptions; - gr.Antialias = Interface.Antialias; + //gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + //gr.SetFontSize (Font.Size); + //gr.FontOptions = Interface.FontRenderingOptions; + //gr.Antialias = Interface.Antialias; rText = new Rectangle (new Size ( measureRawSize (LayoutingType.Width), measureRawSize (LayoutingType.Height))); @@ -259,7 +259,7 @@ namespace Crow } } - gr.FontMatrix = new Matrix (widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0); + //gr.FontMatrix = new Matrix (widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0); int curLineCount = 0; diff --git a/Crow/src/GraphicObjects/Trend.cs b/Crow/src/GraphicObjects/Trend.cs index b62fd2f2..e6d64909 100644 --- a/Crow/src/GraphicObjects/Trend.cs +++ b/Crow/src/GraphicObjects/Trend.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.ComponentModel; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -145,44 +145,44 @@ namespace Crow { base.onDraw (gr); - if (values.Count == 0) - return; - Rectangle r = ClientRectangle; +// if (values.Count == 0) +// return; +// Rectangle r = ClientRectangle; - int i = values.Count -1; +// int i = values.Count -1; - double ptrX = (double)r.Right; - double scaleY = (double)r.Height / (Maximum - Minimum); - double stepX = (double)r.Width / (double)(nbValues-1); +// double ptrX = (double)r.Right; +// double scaleY = (double)r.Height / (Maximum - Minimum); +// double stepX = (double)r.Width / (double)(nbValues-1); - gr.LineWidth = 1.0; - gr.SetDash (new double[]{ 1.0 },0.0); +// gr.LineWidth = 1.0; +// gr.SetDash (new double[]{ 1.0 },0.0); - LowThresholdFill.SetAsSource (gr); - gr.MoveTo (r.Left, r.Bottom - LowThreshold * scaleY); - gr.LineTo (r.Right, r.Bottom - LowThreshold * scaleY); -// gr.Rectangle (r.Left, r.Bottom - LowThreshold * scaleY, r.Width, LowThreshold * scaleY); - gr.Stroke(); +// LowThresholdFill.SetAsSource (gr); +// gr.MoveTo (r.Left, r.Bottom - LowThreshold * scaleY); +// gr.LineTo (r.Right, r.Bottom - LowThreshold * scaleY); +//// gr.Rectangle (r.Left, r.Bottom - LowThreshold * scaleY, r.Width, LowThreshold * scaleY); +// gr.Stroke(); - HighThresholdFill.SetAsSource (gr); - gr.MoveTo (r.Left, (Maximum - HighThreshold) * scaleY); - gr.LineTo (r.Right, (Maximum - HighThreshold) * scaleY); -// gr.Rectangle (r.Left, r.Top, r.Width, (Maximum - HighThreshold) * scaleY); - gr.Stroke(); +// HighThresholdFill.SetAsSource (gr); +// gr.MoveTo (r.Left, (Maximum - HighThreshold) * scaleY); +// gr.LineTo (r.Right, (Maximum - HighThreshold) * scaleY); +//// gr.Rectangle (r.Left, r.Top, r.Width, (Maximum - HighThreshold) * scaleY); + //gr.Stroke(); - gr.MoveTo (ptrX, values [i] * scaleY); + //gr.MoveTo (ptrX, values [i] * scaleY); - Foreground.SetAsSource (gr); - gr.SetDash (new double[]{ }, 0.0); + //Foreground.SetAsSource (gr); + //gr.SetDash (new double[]{ }, 0.0); - while (i >= 0) { - gr.LineTo (ptrX, r.Bottom - values [i] * scaleY); - ptrX -= stepX; - i--; - } - gr.Stroke (); + //while (i >= 0) { + // gr.LineTo (ptrX, r.Bottom - values [i] * scaleY); + // ptrX -= stepX; + // i--; + //} + //gr.Stroke (); } } } diff --git a/Crow/src/GraphicObjects/Widget.cs b/Crow/src/GraphicObjects/Widget.cs index c6efabeb..a5df8791 100644 --- a/Crow/src/GraphicObjects/Widget.cs +++ b/Crow/src/GraphicObjects/Widget.cs @@ -31,7 +31,7 @@ using System.Xml.Serialization; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; -using Crow.Cairo; +using vkvg; using System.Diagnostics; using Crow.IML; using System.Threading; @@ -133,21 +133,21 @@ namespace Crow parentElem.AppendChild (xe); } public Surface CreateIcon (int dragIconSize = 32) { - ImageSurface di = new ImageSurface (Format.Argb32, dragIconSize, dragIconSize); - using (Context ctx = new Context (di)) { - double div = Math.Max (LastPaintedSlot.Width, LastPaintedSlot.Height); - double s = (double)dragIconSize / div; - ctx.Scale (s, s); - if (bmp == null) - this.onDraw (ctx); - else { - if (LastPaintedSlot.Width>LastPaintedSlot.Height) - ctx.SetSourceSurface (bmp, 0, (LastPaintedSlot.Width-LastPaintedSlot.Height)/2); - else - ctx.SetSourceSurface (bmp, (LastPaintedSlot.Height-LastPaintedSlot.Width)/2, 0); - ctx.Paint (); - } - } + Surface di = null; //new ImageSurface (Format.Argb32, dragIconSize, dragIconSize); + //using (Context ctx = new Context (di)) { + // double div = Math.Max (LastPaintedSlot.Width, LastPaintedSlot.Height); + // double s = (double)dragIconSize / div; + // ctx.Scale (s, s); + // if (bmp == null) + // this.onDraw (ctx); + // else { + // if (LastPaintedSlot.Width>LastPaintedSlot.Height) + // ctx.SetSourceSurface (bmp, 0, (LastPaintedSlot.Width-LastPaintedSlot.Height)/2); + // else + // ctx.SetSourceSurface (bmp, (LastPaintedSlot.Height-LastPaintedSlot.Width)/2, 0); + // ctx.Paint (); + // } + //} return di; } public string DesignName { @@ -490,7 +490,7 @@ namespace Crow /// If enabled, resulting bitmap of graphic object is cached /// speeding up rendering of complex object. Default is enabled. /// - [DesignCategory ("Behavior")][DefaultValue(true)] + [DesignCategory ("Behavior")][DefaultValue(false)] public virtual bool CacheEnabled { get { return cacheEnabled; } set { @@ -1656,7 +1656,7 @@ namespace Crow Rectangle rBack = new Rectangle (Slot.Size); background.SetAsSource (gr, rBack); - CairoHelpers.CairoRectangle (gr, rBack, cornerRadius); + DrawingHelpers.CairoRectangle (gr, rBack, cornerRadius); gr.Fill (); #if DEBUG_LOG @@ -1679,10 +1679,10 @@ namespace Crow bmp.SetSize (Slot.Width, Slot.Height);*/ bmp?.Dispose (); //bmp = IFace.surf.CreateSimilar (Content.ColorAlpha, Slot.Width, Slot.Height); - bmp = new ImageSurface(Format.Argb32, Slot.Width, Slot.Height); + bmp = new Surface(IFace.dev, Slot.Width, Slot.Height); using (Context gr = new Context (bmp)) { - gr.Antialias = Interface.Antialias; + //gr.Antialias = Interface.Antialias; onDraw (gr); } @@ -1753,7 +1753,7 @@ namespace Crow } void paintDisabled(Context gr, Rectangle rb){ gr.Operator = Operator.Xor; - gr.SetSourceRGBA (0.6, 0.6, 0.6, 0.3); + gr.SetSourceColor (0.6, 0.6, 0.6, 0.3); gr.Rectangle (rb); gr.Fill (); gr.Operator = Operator.Over; diff --git a/Crow/src/GraphicObjects/Window.cs b/Crow/src/GraphicObjects/Window.cs index a1c0c13f..82080836 100644 --- a/Crow/src/GraphicObjects/Window.cs +++ b/Crow/src/GraphicObjects/Window.cs @@ -296,7 +296,7 @@ namespace Crow if (!hoverBorder) { currentDirection = Direction.None; - IFace.MouseCursor = MouseCursors.Default; + //IFace.MouseCursor = MouseCursors.Default; return; } @@ -330,37 +330,37 @@ namespace Crow else currentDirection = Direction.None; - if (currentDirection != lastDir) { - switch (currentDirection) { - case Direction.None: - otkgw.MouseCursor = MouseCursors.Default; - break; - case Direction.N: - otkgw.MouseCursor = MouseCursors.V; - break; - case Direction.S: - otkgw.MouseCursor = MouseCursors.V; - break; - case Direction.E: - otkgw.MouseCursor = MouseCursors.H; - break; - case Direction.W: - otkgw.MouseCursor = MouseCursors.H; - break; - case Direction.NW: - otkgw.MouseCursor = MouseCursors.NW; - break; - case Direction.NE: - otkgw.MouseCursor = MouseCursors.NE; - break; - case Direction.SW: - otkgw.MouseCursor = MouseCursors.SW; - break; - case Direction.SE: - otkgw.MouseCursor = MouseCursors.SE; - break; - } - } + //if (currentDirection != lastDir) { + // switch (currentDirection) { + // case Direction.None: + // otkgw.MouseCursor = MouseCursors.Default; + // break; + // case Direction.N: + // otkgw.MouseCursor = MouseCursors.V; + // break; + // case Direction.S: + // otkgw.MouseCursor = MouseCursors.V; + // break; + // case Direction.E: + // otkgw.MouseCursor = MouseCursors.H; + // break; + // case Direction.W: + // otkgw.MouseCursor = MouseCursors.H; + // break; + // case Direction.NW: + // otkgw.MouseCursor = MouseCursors.NW; + // break; + // case Direction.NE: + // otkgw.MouseCursor = MouseCursors.NE; + // break; + // case Direction.SW: + // otkgw.MouseCursor = MouseCursors.SW; + // break; + // case Direction.SE: + // otkgw.MouseCursor = MouseCursors.SE; + // break; + // } + //} } } public override void onMouseDown (object sender, MouseButtonEventArgs e) @@ -423,7 +423,7 @@ namespace Crow { hoverBorder = false; currentDirection = Direction.None; - IFace.MouseCursor = MouseCursors.Default; + //IFace.MouseCursor = MouseCursors.Default; } protected virtual void onBorderMouseEnter (object sender, MouseMoveEventArgs e) { @@ -433,7 +433,7 @@ namespace Crow protected void butQuitPress (object sender, MouseButtonEventArgs e) { - IFace.MouseCursor = MouseCursors.Default; + //IFace.MouseCursor = MouseCursors.Default; close (); } diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs index 11221364..70223411 100644 --- a/Crow/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -32,7 +32,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Threading; -using Crow.Cairo; +using vkvg; using Crow.IML; @@ -92,14 +92,15 @@ namespace Crow } } - FontRenderingOptions = new FontOptions (); - FontRenderingOptions.Antialias = Antialias.Subpixel; - FontRenderingOptions.HintMetrics = HintMetrics.On; - FontRenderingOptions.HintStyle = HintStyle.Full; - FontRenderingOptions.SubpixelOrder = SubpixelOrder.Default; + //FontRenderingOptions = new FontOptions (); + //FontRenderingOptions.Antialias = Antialias.Subpixel; + //FontRenderingOptions.HintMetrics = HintMetrics.On; + //FontRenderingOptions.HintStyle = HintStyle.Full; + //FontRenderingOptions.SubpixelOrder = SubpixelOrder.Default; } - public Interface(int width=800, int height=600){ + public Interface(vkvg.Device dev, int width=800, int height=600){ + this.dev = dev; clientRectangle = new Rectangle (0, 0, width, height); @@ -109,6 +110,9 @@ namespace Crow } #endregion + public vkvg.Device dev; + public vkvg.Surface surf; + protected bool running; public void Run () { @@ -147,7 +151,7 @@ namespace Crow { // TODO: dispose managed state (managed objects). } - + surf?.Dispose (); disposedValue = true; @@ -240,9 +244,9 @@ namespace Crow /// will not be rendered on screen public const int MaxDiscardCount = 5; /// Global font rendering settings for Cairo - public static FontOptions FontRenderingOptions; + //public static FontOptions FontRenderingOptions; /// Global font rendering settings for Cairo - public static Antialias Antialias = Antialias.Subpixel; + //public static Antialias Antialias = Antialias.Subpixel; /// /// Each control need a ref to the root interface containing it, if not set in GraphicObject.currentInterface, @@ -255,16 +259,13 @@ namespace Crow #endregion - /// Main Cairo surface - public Surface surf; - #region Public Fields /// Graphic Tree of this interface public List GraphicTree = new List(); /// Interface's resulting bitmap - public byte[] bmp; + //public byte[] bmp; /// resulting bitmap limited to last redrawn part - public byte[] dirtyBmp; + //public byte[] dirtyBmp; /// True when host has to repaint Interface public bool IsDirty; /// Coordinate of the dirty bmp on the original bmp @@ -745,54 +746,54 @@ namespace Crow #endif if (DragImage != null) clipping.AddRectangle(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) { - IsDirty = true; - - clipping.clearAndClip (ctx); - - for (int i = GraphicTree.Count - 1; i >= 0; i--) { - Widget p = GraphicTree[i]; - if (!p.Visible) - continue; - if (!clipping.intersect (p.Slot)) - 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 (); - 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); - } - } + using (ctx = new Context (surf)) { + if (!clipping.IsEmpty) { + IsDirty = true; + + clipping.clear (ctx); + + for (int i = GraphicTree.Count - 1; i >= 0; i--) { + Widget p = GraphicTree[i]; + if (!p.Visible) + continue; + if (!clipping.intersect (p.Slot)) + 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 (); + // 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 - ctx.LineWidth = 1; - clipping.stroke (ctx, Color.Magenta.AdjustAlpha (0.5)); - ctx.Stroke (); + ctx.LineWidth = 1; + clipping.stroke (ctx, Color.Magenta.AdjustAlpha (0.5)); + ctx.Stroke (); #endif - clipping.Reset (); - //} - //surf.WriteToPng (@"/mnt/data/test.png"); - - } + clipping.Reset (); + //} + //surf.WriteToPng (@"/mnt/data/test.png"); + } } + /*#if DEBUG_LOG DebugLog.AddEvent (DbgEvtType.IFaceEndDrawing); #endif*/ @@ -919,10 +920,8 @@ namespace Crow 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]; + surf?.Dispose (); + surf = new Surface (dev, ClientRectangle.Width, ClientRectangle.Height); foreach (Widget g in GraphicTree) g.RegisterForLayouting (LayoutingType.All); @@ -938,11 +937,11 @@ namespace Crow int mouseRepeatCount; MouseButtonEventArgs lastMouseDownEvent; - public MouseCursors MouseCursor { - set { - //backend.SetCursor (value); - } - } + //public MouseCursors MouseCursor { + // set { + // //backend.SetCursor (value); + // } + //} /// Processes mouse move events from the root container, this function /// should be called by the host on mouse move event to forward events to crow interfaces /// true if mouse is in the interface diff --git a/Crow/src/Mono.Cairo/Antialias.cs b/Crow/src/Mono.Cairo/Antialias.cs deleted file mode 100644 index 64da6443..00000000 --- a/Crow/src/Mono.Cairo/Antialias.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// Mono.Cairo.Antialias.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum Antialias - { - Default, - None, - Grey, - Subpixel, - } -} diff --git a/Crow/src/Mono.Cairo/Cairo.cs b/Crow/src/Mono.Cairo/Cairo.cs deleted file mode 100644 index 6450f397..00000000 --- a/Crow/src/Mono.Cairo/Cairo.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Cairo.cs - a simplistic binding of the Cairo API to C#. -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// John Luke (john.luke@gmail.com) -// Alp Toker (alp@atoker.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2005 John Luke -// Copyright (C) 2006 Alp Toker -// -// 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; - -namespace Crow.Cairo -{ - public static class CairoAPI { - static public int Version { - get { - return Crow.Cairo.NativeMethods.cairo_version (); - } - } - - static public string VersionString { - get { - IntPtr x = Crow.Cairo.NativeMethods.cairo_version_string (); - return Marshal.PtrToStringAnsi (x); - } - } - } -} diff --git a/Crow/src/Mono.Cairo/CairoDebug.cs b/Crow/src/Mono.Cairo/CairoDebug.cs deleted file mode 100644 index faff9338..00000000 --- a/Crow/src/Mono.Cairo/CairoDebug.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// CairoDebug.cs -// -// Author: -// Michael Hutchinson (mhutch@xamarin.com) -// -// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.com) -// -// 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 Crow.Cairo { - - static class CairoDebug - { - static System.Collections.Generic.Dictionary traces; - - public static readonly bool Enabled; - - static CairoDebug () - { - var dbg = Environment.GetEnvironmentVariable ("MONO_CAIRO_DEBUG_DISPOSE"); - if (dbg == null) - return; - Enabled = true; - traces = new System.Collections.Generic.Dictionary (); - } - - public static void OnAllocated (IntPtr obj) - { - if (!Enabled) - throw new InvalidOperationException (); - - traces[obj] = Environment.StackTrace; - } - - public static void OnDisposed (IntPtr obj, bool disposing) - { - if (disposing && !Enabled) - throw new InvalidOperationException (); - - if (Environment.HasShutdownStarted) - return; - - if (!disposing) { - Console.Error.WriteLine ("{0} is leaking, programmer is missing a call to Dispose", typeof(T).FullName); - if (Enabled) { - string val; - if (traces.TryGetValue (obj, out val)) { - Console.Error.WriteLine ("Allocated from:"); - Console.Error.WriteLine (val); - } - } else { - Console.Error.WriteLine ("Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces"); - } - } - - if (Enabled) - traces.Remove (obj); - } - } - -} diff --git a/Crow/src/Mono.Cairo/Content.cs b/Crow/src/Mono.Cairo/Content.cs deleted file mode 100644 index f14305a4..00000000 --- a/Crow/src/Mono.Cairo/Content.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// Mono.Cairo.Content.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - //[Flags] - - public enum Content - { - Color = 0x1000, - Alpha = 0x2000, - ColorAlpha = 0x3000, - } -} diff --git a/Crow/src/Mono.Cairo/Context.cs b/Crow/src/Mono.Cairo/Context.cs deleted file mode 100644 index 44e1b5eb..00000000 --- a/Crow/src/Mono.Cairo/Context.cs +++ /dev/null @@ -1,896 +0,0 @@ -// -// Mono.Cairo.Context.cs -// -// Author: -// Duncan Mak (duncan@ximian.com) -// Miguel de Icaza (miguel@novell.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// Alp Toker (alp@atoker.com) -// -// (C) Ximian Inc, 2003. -// (C) Novell Inc, 2003. -// -// This is an OO wrapper API for the Cairo API. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 System.Text; -using Color = Crow.Color; - -namespace Crow.Cairo { - - [Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")] - public class Graphics : Context { - public Graphics (IntPtr state) : base (state) {} - public Graphics (Surface surface) : base (surface) {} - } - - public class Context : IDisposable - { - IntPtr handle = IntPtr.Zero; - - static int native_glyph_size, c_compiler_long_size; - - static Context () - { - // - // This is used to determine what kind of structure - // we should use to marshal Glyphs, as the public - // definition in Cairo uses `long', which can be - // 32 bits or 64 bits depending on the platform. - // - // We assume that sizeof(long) == sizeof(void*) - // except in the case of Win64 where sizeof(long) - // is 32 bits - // - int ptr_size = Marshal.SizeOf (typeof (IntPtr)); - - /*PlatformID platform = Environment.OSVersion.Platform; - RuntimeInformation.IsOSPlatform(OSPlatform.Linux); - RuntimeInformation.OSArchitecture.HasFlag(Architecture.); - if (platform == PlatformID.Win32NT || - platform == PlatformID.Win32S || - platform == PlatformID.Win32Windows || - platform == PlatformID.WinCE || - ptr_size == 4){ - c_compiler_long_size = 4; - native_glyph_size = Marshal.SizeOf (typeof (NativeGlyph_4byte_longs)); - } else {*/ - c_compiler_long_size = 8; - native_glyph_size = Marshal.SizeOf (typeof (Glyph)); - //} - } - - public Context (Surface surface) : this (NativeMethods.cairo_create (surface.Handle), true) - { - } - - - public Context (IntPtr handle, bool owner) - { - this.handle = handle; - if (!owner) - NativeMethods.cairo_reference (handle); - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - [Obsolete] - public Context (IntPtr state) : this (state, true) - { - } - - ~Context () - { - Dispose (false); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing|| handle == IntPtr.Zero) - return; - - NativeMethods.cairo_destroy (handle); - handle = IntPtr.Zero; - - } - - public void Save () - { - NativeMethods.cairo_save (handle); - } - - public void Restore () - { - NativeMethods.cairo_restore (handle); - } - - public Antialias Antialias { - get { return NativeMethods.cairo_get_antialias (handle); } - set { NativeMethods.cairo_set_antialias (handle, value); } - } - - public Crow.Cairo.Status Status { - get { - return NativeMethods.cairo_status (handle); - } - } - - public IntPtr Handle { - get { - return handle; - } - } - - public Operator Operator { - set { - NativeMethods.cairo_set_operator (handle, value); - } - - get { - return NativeMethods.cairo_get_operator (handle); - } - } - - public double Tolerance { - get { - return NativeMethods.cairo_get_tolerance (handle); - } - - set { - NativeMethods.cairo_set_tolerance (handle, value); - } - } - - public Crow.Cairo.FillRule FillRule { - set { - NativeMethods.cairo_set_fill_rule (handle, value); - } - - get { - return NativeMethods.cairo_get_fill_rule (handle); - } - } - - public double LineWidth { - set { - NativeMethods.cairo_set_line_width (handle, value); - } - - get { - return NativeMethods.cairo_get_line_width (handle); - } - } - - public Crow.Cairo.LineCap LineCap { - set { - NativeMethods.cairo_set_line_cap (handle, value); - } - - get { - return NativeMethods.cairo_get_line_cap (handle); - } - } - - public Crow.Cairo.LineJoin LineJoin { - set { - NativeMethods.cairo_set_line_join (handle, value); - } - - get { - return NativeMethods.cairo_get_line_join (handle); - } - } - - public void SetDash (double [] dashes, double offset) - { - NativeMethods.cairo_set_dash (handle, dashes, dashes.Length, offset); - } - - [Obsolete("Use GetSource/SetSource")] - public Pattern Pattern { - set { - SetSource (value); - } - get { - return GetSource (); - } - } - - //This is obsolete because it wasn't obvious it needed to be disposed - [Obsolete("Use GetSource/SetSource")] - public Pattern Source { - set { - SetSource (value); - } - get { - return GetSource (); - } - } - - public void SetSource (Pattern source) - { - NativeMethods.cairo_set_source (handle, source.Handle); - } - - public Pattern GetSource () - { - var ptr = NativeMethods.cairo_get_source (handle); - return Crow.Cairo.Pattern.Lookup (ptr, false); - } - - public double MiterLimit { - set { - NativeMethods.cairo_set_miter_limit (handle, value); - } - - get { - return NativeMethods.cairo_get_miter_limit (handle); - } - } - - public PointD CurrentPoint { - get { - double x, y; - NativeMethods.cairo_get_current_point (handle, out x, out y); - return new PointD (x, y); - } - } - - public bool HasCurrentPoint { - get { - return NativeMethods.cairo_has_current_point (handle); - } - } - - [Obsolete ("Use GetTarget/SetTarget")] - public Crow.Cairo.Surface Target { - set { - if (handle != IntPtr.Zero) - NativeMethods.cairo_destroy (handle); - - handle = NativeMethods.cairo_create (value.Handle); - } - - get { - return GetTarget (); - } - } - - public Surface GetTarget () - { - return Surface.Lookup (NativeMethods.cairo_get_target (handle), false); - } - - public void SetTarget (Surface target) - { - if (handle != IntPtr.Zero) - NativeMethods.cairo_destroy (handle); - handle = NativeMethods.cairo_create (target.Handle); - } - - [Obsolete("Use GetScaledFont/SetScaledFont")] - public ScaledFont ScaledFont { - set { - SetScaledFont (value); - } - - get { - return GetScaledFont (); - } - } - - public ScaledFont GetScaledFont () - { - return new ScaledFont (NativeMethods.cairo_get_scaled_font (handle), false); - } - - public void SetScaledFont (ScaledFont font) - { - NativeMethods.cairo_set_scaled_font (handle, font.Handle); - } - - public uint ReferenceCount { - get { return NativeMethods.cairo_get_reference_count (handle); } - } - - public void SetSourceColor (Color color) - { - NativeMethods.cairo_set_source_rgba (handle, color.R, color.G, color.B, color.A); - } - - public void SetSourceRGB (double r, double g, double b) - { - NativeMethods.cairo_set_source_rgb (handle, r, g, b); - } - - public void SetSourceRGBA (double r, double g, double b, double a) - { - NativeMethods.cairo_set_source_rgba (handle, r, g, b, a); - } - - //[Obsolete ("Use SetSource method (with double parameters)")] - public void SetSourceSurface (Surface source, int x, int y) - { - NativeMethods.cairo_set_source_surface (handle, source.Handle, x, y); - } - - public void SetSource (Surface source, double x, double y) - { - NativeMethods.cairo_set_source_surface (handle, source.Handle, x, y); - } - - public void SetSource (Surface source) - { - NativeMethods.cairo_set_source_surface (handle, source.Handle, 0, 0); - } - -#region Path methods - - public void NewPath () - { - NativeMethods.cairo_new_path (handle); - } - - public void NewSubPath () - { - NativeMethods.cairo_new_sub_path (handle); - } - - public void MoveTo (PointD p) - { - MoveTo (p.X, p.Y); - } - - public void MoveTo (double x, double y) - { - NativeMethods.cairo_move_to (handle, x, y); - } - - public void LineTo (PointD p) - { - LineTo (p.X, p.Y); - } - - public void LineTo (double x, double y) - { - NativeMethods.cairo_line_to (handle, x, y); - } - - public void CurveTo (PointD p1, PointD p2, PointD p3) - { - CurveTo (p1.X, p1.Y, p2.X, p2.Y, p3.X, p3.Y); - } - - public void CurveTo (double x1, double y1, double x2, double y2, double x3, double y3) - { - NativeMethods.cairo_curve_to (handle, x1, y1, x2, y2, x3, y3); - } - - public void RelMoveTo (Distance d) - { - RelMoveTo (d.Dx, d.Dy); - } - - public void RelMoveTo (double dx, double dy) - { - NativeMethods.cairo_rel_move_to (handle, dx, dy); - } - - public void RelLineTo (Distance d) - { - RelLineTo (d.Dx, d.Dy); - } - - public void RelLineTo (double dx, double dy) - { - NativeMethods.cairo_rel_line_to (handle, dx, dy); - } - - public void RelCurveTo (Distance d1, Distance d2, Distance d3) - { - RelCurveTo (d1.Dx, d1.Dy, d2.Dx, d2.Dy, d3.Dx, d3.Dy); - } - - public void RelCurveTo (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3) - { - NativeMethods.cairo_rel_curve_to (handle, dx1, dy1, dx2, dy2, dx3, dy3); - } - - public void Arc (double xc, double yc, double radius, double angle1, double angle2) - { - NativeMethods.cairo_arc (handle, xc, yc, radius, angle1, angle2); - } - - public void ArcNegative (double xc, double yc, double radius, double angle1, double angle2) - { - NativeMethods.cairo_arc_negative (handle, xc, yc, radius, angle1, angle2); - } - - public void Rectangle (Crow.Rectangle rectangle) - { - Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); - } - - public void Rectangle (PointD p, double width, double height) - { - Rectangle (p.X, p.Y, width, height); - } - - public void Rectangle (double x, double y, double width, double height) - { - NativeMethods.cairo_rectangle (handle, x, y, width, height); - } - - public void ClosePath () - { - NativeMethods.cairo_close_path (handle); - } - - public Path CopyPath () - { - return new Path (NativeMethods.cairo_copy_path (handle)); - } - - public Path CopyPathFlat () - { - return new Path (NativeMethods.cairo_copy_path_flat (handle)); - } - - public void AppendPath (Path path) - { - NativeMethods.cairo_append_path (handle, path.Handle); - } - -#endregion - -#region Painting Methods - public void Paint () - { - NativeMethods.cairo_paint (handle); - } - - public void PaintWithAlpha (double alpha) - { - NativeMethods.cairo_paint_with_alpha (handle, alpha); - } - - public void Mask (Pattern pattern) - { - NativeMethods.cairo_mask (handle, pattern.Handle); - } - - public void MaskSurface (Surface surface, double surface_x, double surface_y) - { - NativeMethods.cairo_mask_surface (handle, surface.Handle, surface_x, surface_y); - } - - public void Stroke () - { - NativeMethods.cairo_stroke (handle); - } - - public void StrokePreserve () - { - NativeMethods.cairo_stroke_preserve (handle); - } - - public Crow.Rectangle StrokeExtents () - { - double x1, y1, x2, y2; - NativeMethods.cairo_stroke_extents (handle, out x1, out y1, out x2, out y2); - return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1)); - } - - public void Fill () - { - NativeMethods.cairo_fill (handle); - } - - public Crow.Rectangle FillExtents () - { - double x1, y1, x2, y2; - NativeMethods.cairo_fill_extents (handle, out x1, out y1, out x2, out y2); - return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1)); - } - - public void FillPreserve () - { - NativeMethods.cairo_fill_preserve (handle); - } - -#endregion - - public void Clip () - { - NativeMethods.cairo_clip (handle); - } - - public void ClipPreserve () - { - NativeMethods.cairo_clip_preserve (handle); - } - - public void ResetClip () - { - NativeMethods.cairo_reset_clip (handle); - } - - public bool InClip (double x, double y) - { - return NativeMethods.cairo_in_clip (handle, x, y); - } - public RectangleList GetClipRectangles (){ - return (RectangleList)Marshal.PtrToStructure (NativeMethods.cairo_copy_clip_rectangle_list (handle), typeof(RectangleList)); - } - public void ClipExtendRectangle (){ - double x1, y1, x2, y2; - NativeMethods.cairo_clip_extents (handle, out x1, out y1, out x2, out y2); - NativeMethods.cairo_rectangle (handle, x1, y1, x2 - x1, y2 - y1); - } - public bool InStroke (double x, double y) - { - return NativeMethods.cairo_in_stroke (handle, x, y); - } - - public bool InFill (double x, double y) - { - return NativeMethods.cairo_in_fill (handle, x, y); - } - - public Pattern PopGroup () - { - return Pattern.Lookup (NativeMethods.cairo_pop_group (handle), true); - } - - public void PopGroupToSource () - { - NativeMethods.cairo_pop_group_to_source (handle); - } - - public void PushGroup () - { - NativeMethods.cairo_push_group (handle); - } - - public void PushGroup (Content content) - { - NativeMethods.cairo_push_group_with_content (handle, content); - } - - [Obsolete ("Use GetGroupTarget()")] - public Surface GroupTarget { - get { - return GetGroupTarget (); - } - } - - public Surface GetGroupTarget () - { - IntPtr surface = NativeMethods.cairo_get_group_target (handle); - return Surface.Lookup (surface, false); - } - - public void Rotate (double angle) - { - NativeMethods.cairo_rotate (handle, angle); - } - - public void Scale (double sx, double sy) - { - NativeMethods.cairo_scale (handle, sx, sy); - } - - public void Translate (double tx, double ty) - { - NativeMethods.cairo_translate (handle, tx, ty); - } - - public void Transform (Matrix m) - { - NativeMethods.cairo_transform (handle, m); - } - - [Obsolete("Use UserToDevice instead")] - public void TransformPoint (ref double x, ref double y) - { - NativeMethods.cairo_user_to_device (handle, ref x, ref y); - } - - [Obsolete("Use UserToDeviceDistance instead")] - public void TransformDistance (ref double dx, ref double dy) - { - NativeMethods.cairo_user_to_device_distance (handle, ref dx, ref dy); - } - - [Obsolete("Use InverseTransformPoint instead")] - public void InverseTransformPoint (ref double x, ref double y) - { - NativeMethods.cairo_device_to_user (handle, ref x, ref y); - } - - [Obsolete("Use DeviceToUserDistance instead")] - public void InverseTransformDistance (ref double dx, ref double dy) - { - NativeMethods.cairo_device_to_user_distance (handle, ref dx, ref dy); - } - - public void UserToDevice (ref double x, ref double y) - { - NativeMethods.cairo_user_to_device (handle, ref x, ref y); - } - - public void UserToDeviceDistance (ref double dx, ref double dy) - { - NativeMethods.cairo_user_to_device_distance (handle, ref dx, ref dy); - } - - public void DeviceToUser (ref double x, ref double y) - { - NativeMethods.cairo_device_to_user (handle, ref x, ref y); - } - - public void DeviceToUserDistance (ref double dx, ref double dy) - { - NativeMethods.cairo_device_to_user_distance (handle, ref dx, ref dy); - } - - public Matrix Matrix { - set { - NativeMethods.cairo_set_matrix (handle, value); - } - - get { - Matrix m = new Matrix(); - NativeMethods.cairo_get_matrix (handle, m); - return m; - } - } - - public void SetFontSize (double scale) - { - NativeMethods.cairo_set_font_size (handle, scale); - } - - public void IdentityMatrix () - { - NativeMethods.cairo_identity_matrix (handle); - } - - [Obsolete ("Use SetFontSize() instead.")] - public void FontSetSize (double scale) - { - SetFontSize (scale); - } - - [Obsolete ("Use SetFontSize() instead.")] - public double FontSize { - set { SetFontSize (value); } - } - - public Matrix FontMatrix { - get { - Matrix m; - NativeMethods.cairo_get_font_matrix (handle, out m); - return m; - } - set { NativeMethods.cairo_set_font_matrix (handle, value); } - } - - public FontOptions FontOptions { - get { - FontOptions options = new FontOptions (); - NativeMethods.cairo_get_font_options (handle, options.Handle); - return options; - } - set { NativeMethods.cairo_set_font_options (handle, value.Handle); } - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NativeGlyph_4byte_longs { - public int index; - public double x; - public double y; - - public NativeGlyph_4byte_longs (Glyph source) - { - index = (int) source.index; - x = source.x; - y = source.y; - } - } - - static internal IntPtr FromGlyphToUnManagedMemory(Glyph [] glyphs) - { - IntPtr dest = Marshal.AllocHGlobal (native_glyph_size * glyphs.Length); - long pos = dest.ToInt64(); - - if (c_compiler_long_size == 8){ - foreach (Glyph g in glyphs){ - Marshal.StructureToPtr (g, (IntPtr)pos, false); - pos += native_glyph_size; - } - } else { - foreach (Glyph g in glyphs){ - NativeGlyph_4byte_longs n = new NativeGlyph_4byte_longs (g); - - Marshal.StructureToPtr (n, (IntPtr)pos, false); - pos += native_glyph_size; - } - } - - return dest; - } - - public void ShowGlyphs (Glyph[] glyphs) - { - IntPtr ptr; - - ptr = FromGlyphToUnManagedMemory (glyphs); - - NativeMethods.cairo_show_glyphs (handle, ptr, glyphs.Length); - - Marshal.FreeHGlobal (ptr); - } - - [Obsolete("The matrix argument was never used, use ShowGlyphs(Glyphs []) instead")] - public void ShowGlyphs (Matrix matrix, Glyph[] glyphs) - { - ShowGlyphs (glyphs); - } - - [Obsolete("The matrix argument was never used, use GlyphPath(Glyphs []) instead")] - public void GlyphPath (Matrix matrix, Glyph[] glyphs) - { - GlyphPath (glyphs); - } - - public void GlyphPath (Glyph[] glyphs) - { - IntPtr ptr; - - ptr = FromGlyphToUnManagedMemory (glyphs); - - NativeMethods.cairo_glyph_path (handle, ptr, glyphs.Length); - - Marshal.FreeHGlobal (ptr); - - } - - public FontExtents FontExtents { - get { - FontExtents f_extents; - NativeMethods.cairo_font_extents (handle, out f_extents); - return f_extents; - } - } - - public void CopyPage () - { - NativeMethods.cairo_copy_page (handle); - } - - [Obsolete ("Use SelectFontFace() instead.")] - public void FontFace (string family, FontSlant slant, FontWeight weight) - { - SelectFontFace (family, slant, weight); - } - - [Obsolete("Use GetFontFace/SetFontFace")] - public FontFace ContextFontFace { - get { - return GetContextFontFace (); - } - set { - SetContextFontFace (value); - } - } - - public FontFace GetContextFontFace () - { - return Crow.Cairo.FontFace.Lookup (NativeMethods.cairo_get_font_face (handle), false); - } - - public void SetContextFontFace (FontFace value) - { - NativeMethods.cairo_set_font_face (handle, value == null ? IntPtr.Zero : value.Handle); - } - - public void SelectFontFace (string family, FontSlant slant, FontWeight weight) - { - NativeMethods.cairo_select_font_face (handle, family, slant, weight); - } - - public void ShowPage () - { - NativeMethods.cairo_show_page (handle); - } - - private static byte[] TerminateUtf8(byte[] utf8) - { - if (utf8.Length > 0 && utf8[utf8.Length - 1] == 0) - return utf8; - var termedArray = new byte[utf8.Length + 1]; - Array.Copy(utf8, termedArray, utf8.Length); - termedArray[utf8.Length] = 0; - return termedArray; - } - - private static byte[] TerminateUtf8(string s) - { - // compute the byte count including the trailing \0 - var byteCount = Encoding.UTF8.GetMaxByteCount(s.Length + 1); - var bytes = new byte[byteCount]; - Encoding.UTF8.GetBytes(s, 0, s.Length, bytes, 0); - return bytes; - } - - public void ShowText(string str) - { - NativeMethods.cairo_show_text (handle, str); - } - - - public void TextPath(string str) - { - NativeMethods.cairo_text_path (handle, TerminateUtf8(str)); - } - - public void TextPath(byte[] utf8) - { - NativeMethods.cairo_text_path (handle, TerminateUtf8(utf8)); - } - - public TextExtents TextExtents(string s) - { - TextExtents extents; - NativeMethods.cairo_text_extents (handle, s, out extents); - return extents; - } - - - public TextExtents GlyphExtents (Glyph[] glyphs) - { - IntPtr ptr = FromGlyphToUnManagedMemory (glyphs); - - TextExtents extents; - - NativeMethods.cairo_glyph_extents (handle, ptr, glyphs.Length, out extents); - - Marshal.FreeHGlobal (ptr); - - return extents; - } - } -} diff --git a/Crow/src/Mono.Cairo/DRMDevice.cs b/Crow/src/Mono.Cairo/DRMDevice.cs deleted file mode 100644 index 05e142cb..00000000 --- a/Crow/src/Mono.Cairo/DRMDevice.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Mono.Cairo.Device.cs -// -// Authors: -// JP Bruyère (jp_bruyere@hotmail.com) -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2016 JP 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 Crow.Cairo -{ - public class DRMDevice : Device - { - public DRMDevice () : base (NativeMethods.cairo_drm_device_default (), true) - { - } - public DRMDevice (int fd) : base (NativeMethods.cairo_drm_device_get_for_fd (fd), true) - { - } - public DRMDevice (IntPtr udev_device) : base (NativeMethods.cairo_drm_device_get (udev_device), true) - { - } - - public int FileDescriptor { - get { return NativeMethods.cairo_drm_device_get_fd (Handle); } - } - - public void DeviceThrottle () { NativeMethods.cairo_drm_device_throttle (Handle);} - } -} - diff --git a/Crow/src/Mono.Cairo/DRMSurface.cs b/Crow/src/Mono.Cairo/DRMSurface.cs deleted file mode 100644 index f624967f..00000000 --- a/Crow/src/Mono.Cairo/DRMSurface.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Mono.Cairo.GLSurface.cs -// -// Authors: -// JP Bruyère (jp_bruyere@hotmail.com) -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2016 JP 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 Crow.Cairo { - - public class DRMSurface : Surface - { - - public DRMSurface (IntPtr ptr, bool own) : base (ptr, own) - {} - - public DRMSurface (DRMDevice device, Format format, int width, int height) - : base (NativeMethods.cairo_drm_surface_create (device.Handle, format, width, height), true) - {} - - public DRMSurface (DRMDevice device, uint name, Format format, int width, int height, int stride) - : base (NativeMethods.cairo_drm_surface_create_for_name (device.Handle, name, format, width, height, stride), true) - {} - - public DRMSurface (DRMDevice device, IntPtr imageSurface) - : base (NativeMethods.cairo_drm_surface_create_from_cacheable_image (device.Handle, imageSurface), true) - {} - } -} diff --git a/Crow/src/Mono.Cairo/Device.cs b/Crow/src/Mono.Cairo/Device.cs deleted file mode 100644 index dc9910cb..00000000 --- a/Crow/src/Mono.Cairo/Device.cs +++ /dev/null @@ -1,101 +0,0 @@ -// -// Mono.Cairo.Device.cs -// -// Authors: -// JP Bruyère (jp_bruyere@hotmail.com) -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2016 JP 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 Crow.Cairo -{ - public class Device : IDisposable - { - IntPtr handle = IntPtr.Zero; - - protected Device() - { - } - - protected Device (IntPtr ptr) : this (ptr, true) - { - } - - protected Device (IntPtr handle, bool owner) - { - this.handle = handle; - if (!owner) - NativeMethods.cairo_device_reference (handle); - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - ~Device () - { - Dispose (false); - } - - public IntPtr Handle { - get { - return handle; - } - } - public string Status { - get { - return ""; //System.Runtime.InteropServices.Marshal.PtrToStringAuto(NativeMethods.cairo_status_to_string (NativeMethods.cairo_device_status (handle))); - } - } - public void SetThreadAware (bool value){ - NativeMethods.cairo_gl_device_set_thread_aware (handle, value ? 1 : 0); - } - public Status Acquire() - { - return NativeMethods.cairo_device_acquire (handle); - } - public void Release() - { - NativeMethods.cairo_device_release (handle); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing || handle == IntPtr.Zero) - return; - - NativeMethods.cairo_device_destroy (handle); - handle = IntPtr.Zero; - } - } -} - diff --git a/Crow/src/Mono.Cairo/DirectFBSurface.cs b/Crow/src/Mono.Cairo/DirectFBSurface.cs deleted file mode 100644 index 64431574..00000000 --- a/Crow/src/Mono.Cairo/DirectFBSurface.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// Mono.Cairo.DirectFBSurface.cs -// -// Authors: -// Alp Toker -// -// (C) Alp Toker, 2006. -// -// 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 Crow.Cairo { - public class DirectFBSurface : Surface - { - internal DirectFBSurface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public DirectFBSurface (IntPtr dfb, IntPtr dfb_surface) - : base (NativeMethods.cairo_directfb_surface_create (dfb, dfb_surface), true) - { - } - } -} diff --git a/Crow/src/Mono.Cairo/Distance.cs b/Crow/src/Mono.Cairo/Distance.cs deleted file mode 100644 index d716ab1f..00000000 --- a/Crow/src/Mono.Cairo/Distance.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// Mono.Cairo.Context.cs -// -// Author: -// Duncan Mak (duncan@ximian.com) -// Miguel de Icaza (miguel@novell.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// Alp Toker (alp@atoker.com) -// -// (C) Ximian Inc, 2003. -// (C) Novell Inc, 2003. -// -// This is an OO wrapper API for the Cairo API. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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. -// - -namespace Crow.Cairo { - - public struct Distance - { - public Distance (double dx, double dy) - { - this.dx = dx; - this.dy = dy; - } - - double dx, dy; - public double Dx { - get { return dx; } - set { dx = value; } - } - - public double Dy { - get { return dy; } - set { dy = value; } - } - } -} diff --git a/Crow/src/Mono.Cairo/EGLDevice.cs b/Crow/src/Mono.Cairo/EGLDevice.cs deleted file mode 100644 index 44590c70..00000000 --- a/Crow/src/Mono.Cairo/EGLDevice.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Mono.Cairo.Device.cs -// -// Authors: -// JP Bruyère (jp_bruyere@hotmail.com) -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2016 JP 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 Crow.Cairo -{ - public class EGLDevice : Device - { - public EGLDevice (IntPtr dpy, IntPtr gl_ctx) : base (NativeMethods.cairo_egl_device_create (dpy, gl_ctx), true) - { - } - } -} - diff --git a/Crow/src/Mono.Cairo/Extend.cs b/Crow/src/Mono.Cairo/Extend.cs deleted file mode 100644 index 4af536dc..00000000 --- a/Crow/src/Mono.Cairo/Extend.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Mono.Cairo.Extend.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// John Luke (john.luke@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2005 John Luke -// -// 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 Crow.Cairo -{ - - public enum Extend - { - None, - Repeat, - Reflect, - Pad, - } -} diff --git a/Crow/src/Mono.Cairo/FillRule.cs b/Crow/src/Mono.Cairo/FillRule.cs deleted file mode 100644 index 80f61ed5..00000000 --- a/Crow/src/Mono.Cairo/FillRule.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Mono.Cairo.FillRule.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum FillRule - { - Winding, - EvenOdd - } -} diff --git a/Crow/src/Mono.Cairo/Filter.cs b/Crow/src/Mono.Cairo/Filter.cs deleted file mode 100644 index a73ea58d..00000000 --- a/Crow/src/Mono.Cairo/Filter.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Mono.Cairo.Filter.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum Filter - { - Fast, - Good, - Best, - Nearest, - Bilinear, - Gaussian, - } -} diff --git a/Crow/src/Mono.Cairo/FontFace.cs b/Crow/src/Mono.Cairo/FontFace.cs deleted file mode 100644 index 64c428e2..00000000 --- a/Crow/src/Mono.Cairo/FontFace.cs +++ /dev/null @@ -1,108 +0,0 @@ -// -// Mono.Cairo.FontFace.cs -// -// Author: -// Alp Toker (alp@atoker.com) -// Miguel de Icaza (miguel@novell.com) -// -// (C) Ximian Inc, 2003. -// -// This is an OO wrapper API for the Cairo API. -// -// Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - public class FontFace : IDisposable - { - IntPtr handle; - - internal static FontFace Lookup (IntPtr handle, bool owner) - { - if (handle == IntPtr.Zero) - return null; - return new FontFace (handle, owner); - } - - ~FontFace () - { - Dispose (false); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing|| handle == IntPtr.Zero) - return; - - NativeMethods.cairo_font_face_destroy (handle); - handle = IntPtr.Zero; - } - - [Obsolete] - public FontFace (IntPtr handle) : this (handle, true) - { - } - - public FontFace (IntPtr handle, bool owned) - { - this.handle = handle; - if (!owned) - NativeMethods.cairo_font_face_reference (handle); - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - public IntPtr Handle { - get { - return handle; - } - } - - public Status Status { - get { - return NativeMethods.cairo_font_face_status (handle); - } - } - - public FontType FontType { - get { - return NativeMethods.cairo_font_face_get_type (handle); - } - } - - public uint ReferenceCount { - get { return NativeMethods.cairo_font_face_get_reference_count (handle); } - } - } -} - diff --git a/Crow/src/Mono.Cairo/FontOptions.cs b/Crow/src/Mono.Cairo/FontOptions.cs deleted file mode 100644 index f90a3a4d..00000000 --- a/Crow/src/Mono.Cairo/FontOptions.cs +++ /dev/null @@ -1,143 +0,0 @@ -// -// Mono.Cairo.FontOptions.cs -// -// Author: -// John Luke (john.luke@gmail.com) -// -// (C) John Luke 2005. -// -// 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 Crow.Cairo -{ - public class FontOptions : IDisposable - { - IntPtr handle; - - public FontOptions () : this (NativeMethods.cairo_font_options_create ()) - { - } - - ~FontOptions () - { - Dispose (false); - } - - internal FontOptions (IntPtr handle) - { - this.handle = handle; - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - public FontOptions Copy () - { - return new FontOptions (NativeMethods.cairo_font_options_copy (handle)); - } - - [Obsolete ("Use Dispose()")] - public void Destroy () - { - Dispose (); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing|| handle == IntPtr.Zero) - return; - - NativeMethods.cairo_font_options_destroy (handle); - handle = IntPtr.Zero; - } - - public static bool operator == (FontOptions options, FontOptions other) - { - return Equals (options, other); - } - - public static bool operator != (FontOptions options, FontOptions other) - { - return !(options == other); - } - - public override bool Equals (object other) - { - return Equals (other as FontOptions); - } - - bool Equals (FontOptions options) - { - return options != null && NativeMethods.cairo_font_options_equal (Handle, options.Handle); - } - - public IntPtr Handle { - get { return handle; } - } - - public override int GetHashCode () - { - return (int) NativeMethods.cairo_font_options_hash (handle); - } - - public void Merge (FontOptions other) - { - if (other == null) - throw new ArgumentNullException ("other"); - NativeMethods.cairo_font_options_merge (handle, other.Handle); - } - - public Antialias Antialias { - get { return NativeMethods.cairo_font_options_get_antialias (handle); } - set { NativeMethods.cairo_font_options_set_antialias (handle, value); } - } - - public HintMetrics HintMetrics { - get { return NativeMethods.cairo_font_options_get_hint_metrics (handle);} - set { NativeMethods.cairo_font_options_set_hint_metrics (handle, value); } - } - - public HintStyle HintStyle { - get { return NativeMethods.cairo_font_options_get_hint_style (handle);} - set { NativeMethods.cairo_font_options_set_hint_style (handle, value); } - } - - public Status Status { - get { return NativeMethods.cairo_font_options_status (handle); } - } - - public SubpixelOrder SubpixelOrder { - get { return NativeMethods.cairo_font_options_get_subpixel_order (handle);} - set { NativeMethods.cairo_font_options_set_subpixel_order (handle, value); } - } - } -} - diff --git a/Crow/src/Mono.Cairo/FontSlant.cs b/Crow/src/Mono.Cairo/FontSlant.cs deleted file mode 100644 index b3d8a1a2..00000000 --- a/Crow/src/Mono.Cairo/FontSlant.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// Mono.Cairo.FontSlant.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum FontSlant - { - Normal, - Italic, - Oblique - } -} diff --git a/Crow/src/Mono.Cairo/FontType.cs b/Crow/src/Mono.Cairo/FontType.cs deleted file mode 100644 index 5db44d4e..00000000 --- a/Crow/src/Mono.Cairo/FontType.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Mono.Cairo.FontType.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - - public enum FontType - { - Toy, - FreeType, - Win32, - Atsui, - } -} diff --git a/Crow/src/Mono.Cairo/FontWeight.cs b/Crow/src/Mono.Cairo/FontWeight.cs deleted file mode 100644 index 0b8fc6a8..00000000 --- a/Crow/src/Mono.Cairo/FontWeight.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Mono.Cairo.FontWeight.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum FontWeight - { - Normal, - Bold, - } -} diff --git a/Crow/src/Mono.Cairo/Format.cs b/Crow/src/Mono.Cairo/Format.cs deleted file mode 100644 index 54c8be1e..00000000 --- a/Crow/src/Mono.Cairo/Format.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// Mono.Cairo.Format.cs -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum Format - { - Argb32 = 0, - Rgb24 = 1, - A8 = 2, - A1 = 3, - Rgb16565 = 4, - - //[Obsolete ("Use Argb32")] - ARGB32 = Argb32, - //[Obsolete ("Use Rgb24")] - RGB24 = Rgb24, - } -} diff --git a/Crow/src/Mono.Cairo/GLSurface.cs b/Crow/src/Mono.Cairo/GLSurface.cs deleted file mode 100644 index 179012a4..00000000 --- a/Crow/src/Mono.Cairo/GLSurface.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Mono.Cairo.GLSurface.cs -// -// Authors: -// JP Bruyère (jp_bruyere@hotmail.com) -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2016 JP 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 Crow.Cairo { - - public class GLSurface : Surface - { - - public GLSurface (IntPtr ptr, bool own) : base (ptr, own) - {} - - public GLSurface (Device device, Crow.Cairo.Content content, uint tex, int width, int height) - : base (NativeMethods.cairo_gl_surface_create_for_texture (device.Handle, (uint)content, tex, width, height), true) - {} - - public GLSurface (EGLDevice device, IntPtr eglSurf, int width, int height) - : base (NativeMethods.cairo_gl_surface_create_for_egl (device.Handle, eglSurf, width, height), true) - {} - - public GLSurface (GLXDevice device, IntPtr window, int width, int height) - : base (NativeMethods.cairo_gl_surface_create_for_window (device.Handle, window, width, height),true) - {} - - public GLSurface (WGLDevice device, IntPtr hdc, int width, int height) - : base (NativeMethods.cairo_gl_surface_create_for_dc (device.Handle, hdc, width, height), true) - {} - - public void SwapBuffers(){ - NativeMethods.cairo_gl_surface_swapbuffers (this.Handle); - } - } -} diff --git a/Crow/src/Mono.Cairo/GLXDevice.cs b/Crow/src/Mono.Cairo/GLXDevice.cs deleted file mode 100644 index 00cbce1f..00000000 --- a/Crow/src/Mono.Cairo/GLXDevice.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// Mono.Cairo.Device.cs -// -// Authors: -// JP Bruyère (jp_bruyere@hotmail.com) -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2016 JP 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 Crow.Cairo -{ - public class GLXDevice : Device - { - public GLXDevice (IntPtr dpy, IntPtr gl_ctx) : base (NativeMethods.cairo_glx_device_create (dpy, gl_ctx), true) - { - } - - public IntPtr Display { - get { return NativeMethods.cairo_glx_device_get_display (Handle); } - } - - public IntPtr Context { - get { return NativeMethods.cairo_glx_device_get_context (Handle); } - } - } -} - diff --git a/Crow/src/Mono.Cairo/GlitzSurface.cs b/Crow/src/Mono.Cairo/GlitzSurface.cs deleted file mode 100644 index 4aa24983..00000000 --- a/Crow/src/Mono.Cairo/GlitzSurface.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// Mono.Cairo.GlitzSurface.cs -// -// Authors: -// Alp Toker -// -// (C) Alp Toker, 2006. -// -// 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 Crow.Cairo { - public class GlitzSurface : Surface - { - internal GlitzSurface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public GlitzSurface (IntPtr glitz_surface) - : base (NativeMethods.cairo_glitz_surface_create (glitz_surface), true) - { - } - } -} diff --git a/Crow/src/Mono.Cairo/Glyph.cs b/Crow/src/Mono.Cairo/Glyph.cs deleted file mode 100644 index ad511562..00000000 --- a/Crow/src/Mono.Cairo/Glyph.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// Mono.Cairo.Glyph.cs -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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; - -namespace Crow.Cairo -{ - [StructLayout(LayoutKind.Sequential)] - public struct Glyph - { - internal long index; - internal double x; - internal double y; - - public Glyph (long index, double x, double y) - { - this.index = index; - this.x = x; - this.y = y; - } - - public long Index { - get { return index; } - set { index = value; } - } - - public double X { - get { return x; } - set { x = value; } - } - - public double Y { - get { return y; } - set { y = value; } - } - - public override bool Equals (object obj) - { - if (obj is Glyph) - return this == (Glyph)obj; - return false; - } - - public override int GetHashCode () - { - return (int) Index ^ (int) X ^ (int) Y; - } - - internal static IntPtr GlyphsToIntPtr (Glyph[] glyphs) - { - int size = Marshal.SizeOf (glyphs[0]); - IntPtr dest = Marshal.AllocHGlobal (size * glyphs.Length); - long pos = dest.ToInt64 (); - for (int i = 0; i < glyphs.Length; i++, pos += size) - Marshal.StructureToPtr (glyphs[i], (IntPtr) pos, false); - return dest; - } - - public static bool operator == (Glyph glyph, Glyph other) - { - return glyph.Index == other.Index && glyph.X == other.X && glyph.Y == other.Y; - } - - public static bool operator != (Glyph glyph, Glyph other) - { - return !(glyph == other); - } - } -} diff --git a/Crow/src/Mono.Cairo/Gradient.cs b/Crow/src/Mono.Cairo/Gradient.cs deleted file mode 100644 index 427cc053..00000000 --- a/Crow/src/Mono.Cairo/Gradient.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Mono.Cairo.Gradient.cs -// -// Author: Jordi Mas (jordi@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// (C) Ximian Inc, 2004. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Color = Crow.Color; -namespace Crow.Cairo { - - public class Gradient : Pattern - { - protected Gradient (IntPtr handle, bool owned) : base (handle, owned) - { - } - - [Obsolete] - protected Gradient () - { - } - - public int ColorStopCount { - get { - int cnt; - NativeMethods.cairo_pattern_get_color_stop_count (Handle, out cnt); - return cnt; - } - } - - public Status AddColorStop (double offset, Color c) - { - NativeMethods.cairo_pattern_add_color_stop_rgba (Handle, offset, c.R, c.G, c.B, c.A); - return Status; - } - - public Status AddColorStopRgb (double offset, Color c) - { - NativeMethods.cairo_pattern_add_color_stop_rgb (Handle, offset, c.R, c.G, c.B); - return Status; - } - } -} - diff --git a/Crow/src/Mono.Cairo/HintMetrics.cs b/Crow/src/Mono.Cairo/HintMetrics.cs deleted file mode 100644 index d830f3eb..00000000 --- a/Crow/src/Mono.Cairo/HintMetrics.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Mono.Cairo.HintMetrics.cs -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum HintMetrics - { - Default, - Off, - On, - } -} diff --git a/Crow/src/Mono.Cairo/HintStyle.cs b/Crow/src/Mono.Cairo/HintStyle.cs deleted file mode 100644 index 343daf3e..00000000 --- a/Crow/src/Mono.Cairo/HintStyle.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// Mono.Cairo.HintStyle.cs -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum HintStyle - { - Default, - None, - Slight, - Medium, - Full, - } -} diff --git a/Crow/src/Mono.Cairo/ImageSurface.cs b/Crow/src/Mono.Cairo/ImageSurface.cs deleted file mode 100644 index 1737fe1a..00000000 --- a/Crow/src/Mono.Cairo/ImageSurface.cs +++ /dev/null @@ -1,104 +0,0 @@ -// -// Mono.Cairo.ImageSurface.cs -// -// Authors: -// Duncan Mak -// Miguel de Icaza. -// -// (C) Ximian Inc, 2003. -// (C) Novell, Inc. 2003. -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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; - -namespace Crow.Cairo { - - public class ImageSurface : Surface - { - internal ImageSurface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public ImageSurface (Format format, int width, int height) - : base (NativeMethods.cairo_image_surface_create (format, width, height), true) - { - } - - [Obsolete ("Use ImageSurface (byte[] data, Cairo.Format format, int width, int height, int stride)")] - public ImageSurface (ref byte[] data, Crow.Cairo.Format format, int width, int height, int stride) - : this (data, format, width, height, stride) - { - } - - public ImageSurface (byte[] data, Format format, int width, int height, int stride) - : base (NativeMethods.cairo_image_surface_create_for_data (data, format, width, height, stride), true) - { - } - - public ImageSurface (IntPtr data, Format format, int width, int height, int stride) - : base (NativeMethods.cairo_image_surface_create_for_data (data, format, width, height, stride), true) - { - } - - public ImageSurface (string filename) - : base (NativeMethods.cairo_image_surface_create_from_png (filename), true) - { - } - - public int Width { - get { return NativeMethods.cairo_image_surface_get_width (Handle); } - } - - public int Height { - get { return NativeMethods.cairo_image_surface_get_height (Handle); } - } - - public byte[] Data { - get { - IntPtr ptr = NativeMethods.cairo_image_surface_get_data (Handle); - int length = Height * Stride; - byte[] data = new byte[length]; - Marshal.Copy (ptr, data, 0, length); - return data; - } - } - - public IntPtr DataPtr { - get { - return NativeMethods.cairo_image_surface_get_data (Handle); - } - } - - public Format Format { - get { return NativeMethods.cairo_image_surface_get_format (Handle); } - } - - public int Stride { - get { return NativeMethods.cairo_image_surface_get_stride (Handle); } - } - } -} diff --git a/Crow/src/Mono.Cairo/LineCap.cs b/Crow/src/Mono.Cairo/LineCap.cs deleted file mode 100644 index 1560cda4..00000000 --- a/Crow/src/Mono.Cairo/LineCap.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Mono.Cairo.LineCap.cs -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum LineCap - { - Butt, - Round, - Square, - } -} diff --git a/Crow/src/Mono.Cairo/LineJoin.cs b/Crow/src/Mono.Cairo/LineJoin.cs deleted file mode 100644 index 1d5389b5..00000000 --- a/Crow/src/Mono.Cairo/LineJoin.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// Mono.Cairo.LineJoin.cs -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo -{ - - public enum LineJoin - { - Miter, - Round, - Bevel - } -} - diff --git a/Crow/src/Mono.Cairo/LinearGradient.cs b/Crow/src/Mono.Cairo/LinearGradient.cs deleted file mode 100644 index 100d1e6d..00000000 --- a/Crow/src/Mono.Cairo/LinearGradient.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Mono.Cairo.LinearGradient.cs -// -// Author: Jordi Mas (jordi@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// (C) Ximian Inc, 2004. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo { - - public class LinearGradient : Gradient - { - internal LinearGradient (IntPtr handle, bool owned) : base (handle, owned) - { - } - - public LinearGradient (double x0, double y0, double x1, double y1) - : base (NativeMethods.cairo_pattern_create_linear (x0, y0, x1, y1), true) - { - } - - public PointD[] LinearPoints { - get { - double x0, y0, x1, y1; - PointD[] points = new PointD [2]; - - NativeMethods.cairo_pattern_get_linear_points (Handle, out x0, out y0, out x1, out y1); - - points[0] = new PointD (x0, y0); - points[1] = new PointD (x1, y1); - return points; - } - } - } -} - diff --git a/Crow/src/Mono.Cairo/Matrix.cs b/Crow/src/Mono.Cairo/Matrix.cs deleted file mode 100644 index 9c30845c..00000000 --- a/Crow/src/Mono.Cairo/Matrix.cs +++ /dev/null @@ -1,193 +0,0 @@ -// -// Mono.Cairo.Matrix.cs -// -// Author: Duncan Mak -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// Idan Gazit (idan@fastmail.fm) -// -// (C) Ximian Inc, 2003 - 2005. -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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; - -namespace Crow.Cairo { - - [StructLayout(LayoutKind.Sequential)] - public class Matrix //: ICloneable - { - public double Xx; - public double Yx; - public double Xy; - public double Yy; - public double X0; - public double Y0; - - public Matrix (double xx, double yx, double xy, double yy, - double x0, double y0) - { - this.Xx = xx; this.Yx = yx; this.Xy = xy; - this.Yy = yy; this.X0 = x0; this.Y0 = y0; - } - - public Matrix () - { - this.InitIdentity (); - } - - public bool IsIdentity () - { - return (this == new Matrix ()); - } - - public void InitIdentity () - { - // this.Init(1,0,0,1,0,0); - NativeMethods.cairo_matrix_init_identity (this); - } - - public void Init (double xx, double yx, double xy, double yy, - double x0, double y0) - { - this.Xx = xx; this.Yx = yx; this.Xy = xy; - this.Yy = yy; this.X0 = x0; this.Y0 = y0; - } - - public void InitTranslate (double tx, double ty) - { - //this.Init (1, 0, 0, 1, tx, ty); - NativeMethods.cairo_matrix_init_translate (this, tx, ty); - } - - public void Translate (double tx, double ty) - { - NativeMethods.cairo_matrix_translate (this, tx, ty); - } - - public void InitScale (double sx, double sy) - { - //this.Init (sx, 0, 0, sy, 0, 0); - NativeMethods.cairo_matrix_init_scale (this, sx, sy); - } - - public void Scale (double sx, double sy) - { - NativeMethods.cairo_matrix_scale (this, sx, sy); - } - - public void InitRotate (double radians) - { - /* - double s, c; - s = Math.Sin (radians); - c = Math.Cos (radians); - this.Init (c, s, -s, c, 0, 0); - */ - NativeMethods.cairo_matrix_init_rotate (this, radians); - } - - public void Rotate (double radians) - { - NativeMethods.cairo_matrix_rotate (this, radians); - } - - public Crow.Cairo.Status Invert () - { - return NativeMethods.cairo_matrix_invert (this); - } - - public void Multiply (Matrix b) - { - Matrix a = (Matrix) this.Clone (); - NativeMethods.cairo_matrix_multiply (this, a, b); - } - - public static Matrix Multiply (Matrix a, Matrix b) { - Matrix result = new Matrix (); - NativeMethods.cairo_matrix_multiply (result, a, b); - return result; - } - - - public void TransformDistance (ref double dx, ref double dy) - { - NativeMethods.cairo_matrix_transform_distance (this, ref dx, ref dy); - } - - public void TransformPoint (ref double x, ref double y) - { - NativeMethods.cairo_matrix_transform_point (this, ref x, ref y); - } - - public override String ToString () - { - String s = String.Format ("xx:{0:##0.0#} yx:{1:##0.0#} xy:{2:##0.0#} yy:{3:##0.0#} x0:{4:##0.0#} y0:{5:##0.0#}", - this.Xx, this.Yx, this.Xy, this.Yy, this.X0, this.Y0); - return s; - } - - public static bool operator == (Matrix lhs, Matrix rhs) - { - return (lhs.Xx == rhs.Xx && - lhs.Xy == rhs.Xy && - lhs.Yx == rhs.Yx && - lhs.Yy == rhs.Yy && - lhs.X0 == rhs.X0 && - lhs.Y0 == rhs.Y0 ); - } - - public static bool operator != (Matrix lhs, Matrix rhs) - { - return !(lhs==rhs); - } - - - - public override bool Equals(object o) - { - if (! (o is Matrix)) - return false; - else - return (this == (Matrix) o); - } - - public override int GetHashCode() - { - return (int)this.Xx ^ (int)this.Xx>>32 ^ - (int)this.Xy ^ (int)this.Xy>>32 ^ - (int)this.Yx ^ (int)this.Yx>>32 ^ - (int)this.Yy ^ (int)this.Yy>>32 ^ - (int)this.X0 ^ (int)this.X0>>32 ^ - (int)this.Y0 ^ (int)this.Y0>>32; - } - - public object Clone() - { - return this.MemberwiseClone (); - } - - } -} diff --git a/Crow/src/Mono.Cairo/MeshPattern.cs b/Crow/src/Mono.Cairo/MeshPattern.cs deleted file mode 100644 index 96bc3c85..00000000 --- a/Crow/src/Mono.Cairo/MeshPattern.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// Mono.Cairo.Pattern.cs -// -// Author: Jordi Mas (jordi@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// (C) Ximian Inc, 2004. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo { - - public class MeshPattern : Pattern - { - internal MeshPattern (IntPtr handle, bool owned) : base (handle, owned) - { - } - - public MeshPattern () - : base (NativeMethods.cairo_pattern_create_mesh(), true) - { - } - - //no idea why this is here, the base one is identical, but we can't remove it now - public new Extend Extend { - set { NativeMethods.cairo_pattern_set_extend (Handle, value); } - get { return NativeMethods.cairo_pattern_get_extend (Handle); } - } - - public Filter Filter { - set { NativeMethods.cairo_pattern_set_filter (Handle, value); } - get { return NativeMethods.cairo_pattern_get_filter (Handle); } - } - - public void BeginPatch(){ - NativeMethods.cairo_mesh_pattern_begin_patch (Handle); - } - public void EndPatch(){ - NativeMethods.cairo_mesh_pattern_end_patch (Handle); - } - public void MoveTo(double x, double y){ - NativeMethods.cairo_mesh_pattern_move_to (Handle, x, y); - } - public void LineTo(double x, double y){ - NativeMethods.cairo_mesh_pattern_line_to (Handle, x, y); - } - public void CurveTo(double x1, double y1, double x2, double y2, double x3, double y3) - { - NativeMethods.cairo_mesh_pattern_curve_to (Handle, x1, y1, x2, y2, x3, y3); - } - public void SetControlPoint(uint point_num, double x, double y){ - NativeMethods.cairo_mesh_pattern_set_control_point (Handle, point_num, x, y); - } - public void SetCornerColorRGB(uint corner_num, double r, double g, double b){ - NativeMethods.cairo_mesh_pattern_set_corner_color_rgb (Handle, corner_num, r, g, b); - } - public void SetCornerColorRGBA(uint corner_num, double r, double g, double b, double a){ - NativeMethods.cairo_mesh_pattern_set_corner_color_rgba (Handle, corner_num, r, g, b, a); - } - public uint PatchCount { - get { - uint count = 0; - NativeMethods.cairo_mesh_pattern_get_patch_count(Handle, out count); - return count; - } - } - public Path GetPath(uint patch_num){ - return new Path(NativeMethods.cairo_mesh_pattern_get_path(Handle, patch_num)); - } - public void GetControlPoint(){ - } - public void GetCornerColorRGBA(){ - - } - } -} - diff --git a/Crow/src/Mono.Cairo/NativeMethods-internal.cs b/Crow/src/Mono.Cairo/NativeMethods-internal.cs deleted file mode 100644 index 6e6d507c..00000000 --- a/Crow/src/Mono.Cairo/NativeMethods-internal.cs +++ /dev/null @@ -1,1026 +0,0 @@ -// -// Cairo.cs - a simplistic binding of the Cairo API to C#. -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// John Luke (john.luke@gmail.com) -// Alp Toker (alp@atoker.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2005 John Luke -// Copyright (C) 2006 Alp Toker -// -// 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 System.Runtime.CompilerServices; - -namespace Cairo -{ - // sort the functions like in the following page so it is easier to find what is missing - // http://cairographics.org/manual/index-all.html - - public static class NativeMethods - { - #if MONOTOUCH - const string cairo = "__Internal"; - #else - const string cairo = "libcairo-2.dll"; - #endif - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern void cairo_append_path (IntPtr cr, Path path); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); - - // [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - // public static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_clip (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_clip_preserve (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_close_path (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_copy_page (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_copy_path (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_copy_path_flat (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_create (IntPtr target); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_debug_reset_static_data (); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_destroy (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_fill (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_fill_preserve (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_extents (IntPtr cr, out FontExtents extents); - - #region FontFace - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_face_destroy (IntPtr font_face); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern FontType cairo_font_face_get_type (IntPtr font_face); - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern void cairo_font_face_get_user_data (IntPtr font_face); - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern void cairo_font_face_set_user_data (IntPtr font_face); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_font_face_reference (IntPtr font_face); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_font_face_status (IntPtr font_face); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern uint cairo_font_face_get_reference_count (IntPtr surface); - #endregion - - #region FontOptions - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_font_options_copy (IntPtr original); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_font_options_create (); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_options_destroy (IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern bool cairo_font_options_equal (IntPtr options, IntPtr other); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Antialias cairo_font_options_get_antialias (IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern HintStyle cairo_font_options_get_hint_style (IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern long cairo_font_options_hash (IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_options_merge (IntPtr options, IntPtr other); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_font_options_status (IntPtr options); - #endregion - - #region Freetype / FontConfig - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Antialias cairo_get_antialias (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_get_current_point (IntPtr cr, out double x, out double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern FillRule cairo_get_fill_rule (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_get_font_face (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_get_font_options (IntPtr cr, IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_get_group_target (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern LineCap cairo_get_line_cap (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern LineJoin cairo_get_line_join (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern double cairo_get_line_width (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_get_matrix (IntPtr cr, Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern double cairo_get_miter_limit (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Operator cairo_get_operator (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern uint cairo_get_reference_count (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_get_source (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_get_target (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern double cairo_get_tolerance (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_glitz_surface_create (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - [return: MarshalAs (UnmanagedType.U1)] - public static extern bool cairo_has_current_point (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_identity_matrix (IntPtr cr); - - #region Image Surface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - public static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_image_surface_create_from_png (string filename); - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern IntPtr cairo_image_surface_create_from_png_stream (string filename); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_image_surface_get_data (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Format cairo_image_surface_get_format (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_image_surface_get_height (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_image_surface_get_stride (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_image_surface_get_width (IntPtr surface); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - [return: MarshalAs (UnmanagedType.U1)] - public static extern bool cairo_in_clip (IntPtr cr, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - [return: MarshalAs (UnmanagedType.U1)] - public static extern bool cairo_in_fill (IntPtr cr, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - [return: MarshalAs (UnmanagedType.U1)] - public static extern bool cairo_in_stroke (IntPtr cr, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_line_to (IntPtr cr, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_mask (IntPtr cr, IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y); - - #region Matrix - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_init_identity (Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_init_rotate (Matrix matrix, double radians); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_matrix_invert (Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_rotate (Matrix matrix, double radians); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_move_to (IntPtr cr, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_new_path (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_new_sub_path (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_paint (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_paint_with_alpha (IntPtr cr, double alpha); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_path_destroy (IntPtr path); - - #region Pattern - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count); - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pattern_destroy (IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Extend cairo_pattern_get_extend (IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Filter cairo_pattern_get_filter (IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern PatternType cairo_pattern_get_type (IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pattern_reference (IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_pattern_status (IntPtr pattern); - #endregion - - #region PdfSurface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height); - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y); - #endregion - - #region PostscriptSurface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_ps_surface_create (string filename, double width, double height); - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height); - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_ps_surface_dsc_begin_page_setup (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_ps_surface_dsc_begin_setup (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_pop_group (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_pop_group_to_source (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_push_group (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_push_group_with_content (IntPtr cr, Content content); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_reference (IntPtr cr); - - #region Regions - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern bool cairo_region_contains_point (IntPtr region, int x, int y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern RegionOverlap cairo_region_contains_rectangle (IntPtr region, ref Crow.Rectangle rectangle); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_region_copy (IntPtr original); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_region_create (); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_region_create_rectangle (ref Crow.Rectangle rect); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_region_create_rectangles (IntPtr rects, int count); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_region_destroy (IntPtr region); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern bool cairo_region_equal (IntPtr a, IntPtr b); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_region_get_extents (IntPtr region, out Crow.Rectangle extents); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_region_get_rectangle (IntPtr region, int nth, out Crow.Rectangle rectangle); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_intersect (IntPtr dst, IntPtr other); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_intersect_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern bool cairo_region_is_empty (IntPtr region); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_region_num_rectangles (IntPtr region); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_region_reference (IntPtr region); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_status (IntPtr region); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_subtract (IntPtr dst, IntPtr other); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_subtract_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_region_translate (IntPtr region, int dx, int dy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_union (IntPtr dst, IntPtr other); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_union_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_xor (IntPtr dst, IntPtr other); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_region_xor_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_reset_clip (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_restore (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_rotate (IntPtr cr, double angle); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_save (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_scale (IntPtr cr, double sx, double sy); - - #region ScaledFont - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_scaled_font_status (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_get_scaled_font (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - public static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, byte[] utf8, out TextExtents extents); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_antialias (IntPtr cr, Antialias antialias); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - public static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_get_dash_count (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - public static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_font_options (IntPtr cr, IntPtr options); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_font_size (IntPtr cr, double size); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_line_width (IntPtr cr, double width); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_matrix (IntPtr cr, Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_miter_limit (IntPtr cr, double limit); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_source (IntPtr cr, IntPtr pattern); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_set_tolerance (IntPtr cr, double tolerance); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_show_page (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_show_text (IntPtr cr, string str); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_status (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_status_to_string (Status status); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_stroke (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_stroke_preserve (IntPtr cr); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr); - - #region Surface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_destroy (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_finish (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_flush (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Content cairo_surface_get_content (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern uint cairo_surface_get_reference_count (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern SurfaceType cairo_surface_get_type (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_mark_dirty (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_surface_reference (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_surface_status (IntPtr surface); - #endregion - - #region SVG surface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_surface_write_to_png (IntPtr surface, string filename); - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height); - - //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - //public static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_text_extents (IntPtr cr, string txt, out TextExtents extents); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - public static extern void cairo_text_path (IntPtr ct, byte[] utf8); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_transform (IntPtr cr, Matrix matrix); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_translate (IntPtr cr, double tx, double ty); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_version (); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_version_string (); - - #region DirectFBSurface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface); - #endregion - - #region win32 fonts - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc); - #endregion - - #region win32 surface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_win32_surface_create (IntPtr hdc); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height); - #endregion - - #region XcbSurface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height); - #endregion - - #region XlibSurface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_xlib_surface_get_depth (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_xlib_surface_get_height (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_xlib_surface_get_width (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height); - #endregion - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_gl_device_set_thread_aware(IntPtr device, int value); - - #region GLSurface - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_gl_surface_create (IntPtr device, uint content, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_gl_surface_create_for_texture (IntPtr device, uint content, uint tex, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_gl_surface_set_size (IntPtr surface, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_gl_surface_get_width (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_gl_surface_get_height (IntPtr surface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_gl_surface_swapbuffers (IntPtr surf); - #endregion - - #region GLX Functions - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_glx_device_create (IntPtr dpy, IntPtr gl_ctx); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_glx_device_get_display (IntPtr device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_glx_device_get_context (IntPtr device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_gl_surface_create_for_window (IntPtr device, IntPtr window, int width, int height); - #endregion - - #region WGL Fucntions - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_wgl_device_create (IntPtr hglrc); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_wgl_device_get_context (IntPtr device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_gl_surface_create_for_dc (IntPtr device, IntPtr hdc, int width, int height); - #endregion - - #region EGL Functions - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_egl_device_create (IntPtr dpy, IntPtr gl_ctx); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_gl_surface_create_for_egl (IntPtr device, IntPtr eglSurface, int width, int height); - #endregion - - #region DRM Functions - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_device_get (IntPtr udev_device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_device_get_for_fd (int fd); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_device_default (); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_drm_device_get_fd (IntPtr cairo_device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_drm_device_throttle (IntPtr cairo_device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_surface_create (IntPtr cairo_device, Format format, int width, int height); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_surface_create_for_name (IntPtr cairo_device, uint name, Format format, int width, int height, int stride); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_surface_create_from_cacheable_image (IntPtr cairo_device, IntPtr imageSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_drm_surface_enable_scan_out (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_surface_get_handle (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_surface_get_name (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Format cairo_drm_surface_get_format (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_drm_surface_get_width (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_drm_surface_get_height (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern int cairo_drm_surface_get_stride (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_drm_surface_map_to_image (IntPtr drmSurface); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_drm_surface_unmap (IntPtr drmSurface, IntPtr imageSurface); - #endregion - - #region Device - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_device_acquire(IntPtr device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_device_destroy (IntPtr device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern IntPtr cairo_device_reference (IntPtr device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void cairo_device_release(IntPtr device); - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern Status cairo_device_status(IntPtr device); - #endregion - - - - [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute] - public static extern void crow_cairo_region_clear(IntPtr ctx, IntPtr reg); - - } -} \ No newline at end of file diff --git a/Crow/src/Mono.Cairo/NativeMethods.cs b/Crow/src/Mono.Cairo/NativeMethods.cs deleted file mode 100644 index 5c4dfcf7..00000000 --- a/Crow/src/Mono.Cairo/NativeMethods.cs +++ /dev/null @@ -1,1065 +0,0 @@ -// -// Cairo.cs - a simplistic binding of the Cairo API to C#. -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// John Luke (john.luke@gmail.com) -// Alp Toker (alp@atoker.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2005 John Luke -// Copyright (C) 2006 Alp Toker -// -// 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; - -namespace Crow.Cairo -{ - // sort the functions like in the following page so it is easier to find what is missing - // http://cairographics.org/manual/index-all.html - - internal static class NativeMethods - { -#if MONOTOUCH - const string cairo = "__Internal"; -#else - const string cairo = "cairo"; -#endif - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern void cairo_append_path (IntPtr cr, Path path); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_clip (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_clip_preserve (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_close_path (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_copy_page (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_copy_path (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_copy_path_flat (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_create (IntPtr target); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_debug_reset_static_data (); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_destroy (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_fill (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_fill_preserve (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_extents (IntPtr cr, out FontExtents extents); - - #region FontFace - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_face_destroy (IntPtr font_face); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern FontType cairo_font_face_get_type (IntPtr font_face); - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern void cairo_font_face_get_user_data (IntPtr font_face); - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern void cairo_font_face_set_user_data (IntPtr font_face); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_font_face_reference (IntPtr font_face); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_font_face_status (IntPtr font_face); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern uint cairo_font_face_get_reference_count (IntPtr surface); - #endregion - - #region FontOptions - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_font_options_copy (IntPtr original); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_font_options_create (); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_options_destroy (IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - [return: MarshalAs (UnmanagedType.U1)] - internal static extern bool cairo_font_options_equal (IntPtr options, IntPtr other); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Antialias cairo_font_options_get_antialias (IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern HintStyle cairo_font_options_get_hint_style (IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern long cairo_font_options_hash (IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_options_merge (IntPtr options, IntPtr other); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_font_options_status (IntPtr options); - #endregion - - #region Freetype / FontConfig - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Antialias cairo_get_antialias (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_get_current_point (IntPtr cr, out double x, out double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern FillRule cairo_get_fill_rule (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_get_font_face (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_get_font_options (IntPtr cr, IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_get_group_target (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern LineCap cairo_get_line_cap (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern LineJoin cairo_get_line_join (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern double cairo_get_line_width (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_get_matrix (IntPtr cr, Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern double cairo_get_miter_limit (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Operator cairo_get_operator (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern uint cairo_get_reference_count (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_get_source (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_get_target (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern double cairo_get_tolerance (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_glitz_surface_create (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - [return: MarshalAs (UnmanagedType.U1)] - internal static extern bool cairo_has_current_point (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_identity_matrix (IntPtr cr); - - #region Image Surface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_image_surface_create (Crow.Cairo.Format format, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Crow.Cairo.Format format, int width, int height, int stride); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Crow.Cairo.Format format, int width, int height, int stride); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_image_surface_create_from_png (string filename); - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern IntPtr cairo_image_surface_create_from_png_stream (string filename); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_image_surface_get_data (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Format cairo_image_surface_get_format (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_image_surface_get_height (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_image_surface_get_stride (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_image_surface_get_width (IntPtr surface); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - [return: MarshalAs (UnmanagedType.U1)] - internal static extern bool cairo_in_clip (IntPtr cr, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - [return: MarshalAs (UnmanagedType.U1)] - internal static extern bool cairo_in_fill (IntPtr cr, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - [return: MarshalAs (UnmanagedType.U1)] - internal static extern bool cairo_in_stroke (IntPtr cr, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_line_to (IntPtr cr, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mask (IntPtr cr, IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y); - - #region Matrix - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_init_identity (Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_init_rotate (Matrix matrix, double radians); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_matrix_invert (Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_rotate (Matrix matrix, double radians); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_move_to (IntPtr cr, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_new_path (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_new_sub_path (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_paint (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_paint_with_alpha (IntPtr cr, double alpha); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_path_destroy (IntPtr path); - - #region Pattern - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count); - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pattern_destroy (IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Extend cairo_pattern_get_extend (IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Filter cairo_pattern_get_filter (IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern PatternType cairo_pattern_get_type (IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pattern_reference (IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_pattern_status (IntPtr pattern); - - //mesh pattern - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pattern_create_mesh (); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_begin_patch (IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_end_patch (IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_move_to (IntPtr pattern, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_line_to (IntPtr pattern, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_curve_to (IntPtr pattern, double x1, double y1, - double x2, double y2, double x3, double y3); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_set_control_point (IntPtr pattern, uint point_num, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_set_corner_color_rgb (IntPtr pattern, uint corner_num, - double r, double g, double b); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_mesh_pattern_set_corner_color_rgba (IntPtr pattern, uint corner_num, - double r, double g, double b, double a); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_mesh_pattern_get_patch_count (IntPtr pattern, out uint count); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_mesh_pattern_get_path (IntPtr pattern, uint patch_num); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_mesh_pattern_get_control_point (IntPtr pattern, - uint patch_num, uint point_num, out double x, out double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_mesh_pattern_get_corner_color_rgba (IntPtr pattern, - uint patch_num, uint point_num, out double r, out double g, out double b, out double a); - #endregion - - #region PdfSurface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height); - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y); - #endregion - - #region PostscriptSurface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_ps_surface_create (string filename, double width, double height); - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height); - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_ps_surface_dsc_begin_page_setup (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_ps_surface_dsc_begin_setup (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_pop_group (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_pop_group_to_source (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_push_group (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_push_group_with_content (IntPtr cr, Content content); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_reference (IntPtr cr); - - #region Regions - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern bool cairo_region_contains_point (IntPtr region, int x, int y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern RegionOverlap cairo_region_contains_rectangle (IntPtr region, ref Crow.Rectangle rectangle); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_region_copy (IntPtr original); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_region_create (); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_region_create_rectangle (ref Crow.Rectangle rect); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_region_create_rectangles (IntPtr rects, int count); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_region_destroy (IntPtr region); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern bool cairo_region_equal (IntPtr a, IntPtr b); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_region_get_extents (IntPtr region, out Crow.Rectangle extents); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_region_get_rectangle (IntPtr region, int nth, out Crow.Rectangle rectangle); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_intersect (IntPtr dst, IntPtr other); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_intersect_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern bool cairo_region_is_empty (IntPtr region); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_region_num_rectangles (IntPtr region); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_region_reference (IntPtr region); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_status (IntPtr region); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_subtract (IntPtr dst, IntPtr other); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_subtract_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_region_translate (IntPtr region, int dx, int dy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_union (IntPtr dst, IntPtr other); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_union_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_xor (IntPtr dst, IntPtr other); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_region_xor_rectangle (IntPtr dst, ref Crow.Rectangle rectangle); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_reset_clip (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_restore (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_rotate (IntPtr cr, double angle); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_save (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_scale (IntPtr cr, double sx, double sy); - - #region ScaledFont - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_scaled_font_status (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_get_scaled_font (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, byte[] utf8, out TextExtents extents); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_antialias (IntPtr cr, Antialias antialias); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_get_dash_count (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_fill_rule (IntPtr cr, Crow.Cairo.FillRule fill_rule); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_font_options (IntPtr cr, IntPtr options); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_font_size (IntPtr cr, double size); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_line_width (IntPtr cr, double width); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_matrix (IntPtr cr, Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_miter_limit (IntPtr cr, double limit); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_operator (IntPtr cr, Crow.Cairo.Operator op); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_source (IntPtr cr, IntPtr pattern); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_set_tolerance (IntPtr cr, double tolerance); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_show_page (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_show_text (IntPtr cr, string text); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_status (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_status_to_string (Status status); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_stroke (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_stroke_preserve (IntPtr cr); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr); - - #region Surface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_surface_create_similar (IntPtr surface, Crow.Cairo.Content content, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_destroy (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_finish (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_flush (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Content cairo_surface_get_content (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern uint cairo_surface_get_reference_count (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern SurfaceType cairo_surface_get_type (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_mark_dirty (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_surface_reference (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_surface_status (IntPtr surface); - #endregion - - #region SVG surface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_surface_write_to_png (IntPtr surface, string filename); - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height); - - //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - //internal static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_text_extents (IntPtr cr, string text, out TextExtents extents); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_text_path (IntPtr ct, byte[] utf8); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_transform (IntPtr cr, Matrix matrix); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_translate (IntPtr cr, double tx, double ty); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_version (); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_version_string (); - - #region DirectFBSurface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface); - #endregion - - #region win32 fonts - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc); - #endregion - - #region win32 surface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_win32_surface_create (IntPtr hdc); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height); - #endregion - - #region XcbSurface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height); - #endregion - - #region XlibSurface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_xlib_surface_get_depth (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_xlib_surface_get_height (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_xlib_surface_get_width (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height); - #endregion - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_gl_device_set_thread_aware(IntPtr device, int value); - - #region GLSurface - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_gl_surface_create (IntPtr device, uint content, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_gl_surface_create_for_texture (IntPtr device, uint content, uint tex, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_gl_surface_set_size (IntPtr surface, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_gl_surface_get_width (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_gl_surface_get_height (IntPtr surface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_gl_surface_swapbuffers (IntPtr surf); - #endregion - - #region GLX Functions - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_glx_device_create (IntPtr dpy, IntPtr gl_ctx); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_glx_device_get_display (IntPtr device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_glx_device_get_context (IntPtr device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_gl_surface_create_for_window (IntPtr device, IntPtr window, int width, int height); - #endregion - - #region WGL Fucntions - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_wgl_device_create (IntPtr hglrc); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_wgl_device_get_context (IntPtr device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_gl_surface_create_for_dc (IntPtr device, IntPtr hdc, int width, int height); - #endregion - - #region EGL Functions - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_egl_device_create (IntPtr dpy, IntPtr gl_ctx); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_gl_surface_create_for_egl (IntPtr device, IntPtr eglSurface, int width, int height); - #endregion - - #region DRM Functions - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_device_get (IntPtr udev_device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_device_get_for_fd (int fd); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_device_default (); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_drm_device_get_fd (IntPtr cairo_device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_drm_device_throttle (IntPtr cairo_device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_surface_create (IntPtr cairo_device, Format format, int width, int height); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_surface_create_for_name (IntPtr cairo_device, uint name, Format format, int width, int height, int stride); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_surface_create_from_cacheable_image (IntPtr cairo_device, IntPtr imageSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_drm_surface_enable_scan_out (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_surface_get_handle (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_surface_get_name (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Format cairo_drm_surface_get_format (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_drm_surface_get_width (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_drm_surface_get_height (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern int cairo_drm_surface_get_stride (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_drm_surface_map_to_image (IntPtr drmSurface); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_drm_surface_unmap (IntPtr drmSurface, IntPtr imageSurface); - #endregion - - #region Device - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_device_acquire(IntPtr device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_device_destroy (IntPtr device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern IntPtr cairo_device_reference (IntPtr device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern void cairo_device_release(IntPtr device); - - [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)] - internal static extern Status cairo_device_status(IntPtr device); - #endregion - } -} \ No newline at end of file diff --git a/Crow/src/Mono.Cairo/Operator.cs b/Crow/src/Mono.Cairo/Operator.cs deleted file mode 100644 index 1c11cccc..00000000 --- a/Crow/src/Mono.Cairo/Operator.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Mono.Cairo.Operator.cs -// -// Authors: Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// John Luke (john.luke@gmail.com) -// -// (C) Ximian, Inc. 2003 -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2005 John Luke -// -// 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 Crow.Cairo -{ - - public enum Operator - { - Clear, - Source, - Over, - In, - Out, - Atop, - - Dest, - DestOver, - DestIn, - DestOut, - DestAtop, - - Xor, - Add, - Saturate, - Multiply, - Screen, - Overlay, - Darken, - Lighten, - - } -} diff --git a/Crow/src/Mono.Cairo/PSSurface.cs b/Crow/src/Mono.Cairo/PSSurface.cs deleted file mode 100644 index cf90794e..00000000 --- a/Crow/src/Mono.Cairo/PSSurface.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Mono.Cairo.PostscriptSurface.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - public class PSSurface : Surface - { - internal PSSurface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public PSSurface (string filename, double width, double height) - : base (NativeMethods.cairo_ps_surface_create (filename, width, height), true) - { - } - - public void BeginPageSetup () - { - NativeMethods.cairo_ps_surface_dsc_begin_page_setup (Handle); - } - - public void BeginSetup () - { - NativeMethods.cairo_ps_surface_dsc_begin_setup (Handle); - } - - public void DscComment (string comment) - { - NativeMethods.cairo_ps_surface_dsc_comment (Handle, comment); - } - - public void SetSize (double width, double height) - { - NativeMethods.cairo_ps_surface_set_size (Handle, width, height); - } - } -} diff --git a/Crow/src/Mono.Cairo/Path.cs b/Crow/src/Mono.Cairo/Path.cs deleted file mode 100644 index a55f03b0..00000000 --- a/Crow/src/Mono.Cairo/Path.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Mono.Cairo.Context.cs -// -// Author: -// Miguel de Icaza (miguel@novell.com) -// -// This is an OO wrapper API for the Cairo API. -// -// Copyright 2007 Novell, Inc (http://www.novell.com) -// -// 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.Cairo; - -namespace Crow.Cairo { - - public class Path : IDisposable - { - IntPtr handle = IntPtr.Zero; - - internal Path (IntPtr handle) - { - this.handle = handle; - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - ~Path () - { - Dispose (false); - } - - public IntPtr Handle { get { return handle; } } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing|| handle == IntPtr.Zero) - return; - - NativeMethods.cairo_path_destroy (handle); - handle = IntPtr.Zero; - } - } -} diff --git a/Crow/src/Mono.Cairo/Pattern.cs b/Crow/src/Mono.Cairo/Pattern.cs deleted file mode 100644 index 3e933a19..00000000 --- a/Crow/src/Mono.Cairo/Pattern.cs +++ /dev/null @@ -1,155 +0,0 @@ -// -// Mono.Cairo.Pattern.cs -// -// Author: Jordi Mas (jordi@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// (C) Ximian Inc, 2004. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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.Collections; - -namespace Crow.Cairo { - - public class Pattern : IDisposable - { - [Obsolete] - protected IntPtr pattern = IntPtr.Zero; - - public static Pattern Lookup (IntPtr pattern, bool owner) - { - if (pattern == IntPtr.Zero) - return null; - - PatternType pt = NativeMethods.cairo_pattern_get_type (pattern); - switch (pt) { - case PatternType.Solid: - return new SolidPattern (pattern, owner); - case PatternType.Surface: - return new SurfacePattern (pattern, owner); - case PatternType.Linear: - return new LinearGradient (pattern, owner); - case PatternType.Radial: - return new RadialGradient (pattern, owner); - default: - return new Pattern (pattern, owner); - } - } - - [Obsolete] - protected Pattern () - { - } - - internal Pattern (IntPtr handle, bool owned) - { - Handle = handle; - if (!owned) - NativeMethods.cairo_pattern_reference (handle); - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - ~Pattern () - { - Dispose (false); - } - - [Obsolete ("Use the SurfacePattern constructor")] - public Pattern (Surface surface) - : this ( NativeMethods.cairo_pattern_create_for_surface (surface.Handle), true) - { - } - - [Obsolete] - protected void Reference () - { - NativeMethods.cairo_pattern_reference (pattern); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (Handle, disposing); - - if (!disposing|| Handle == IntPtr.Zero) - return; - - NativeMethods.cairo_pattern_destroy (Handle); - Handle = IntPtr.Zero; - } - - [Obsolete ("Use Dispose()")] - public void Destroy () - { - Dispose (); - } - - public Status Status - { - get { return NativeMethods.cairo_pattern_status (Handle); } - } - - public Extend Extend - { - get { return NativeMethods.cairo_pattern_get_extend (Handle); } - set { NativeMethods.cairo_pattern_set_extend (Handle, value); } - } - - public Matrix Matrix { - set { - NativeMethods.cairo_pattern_set_matrix (Handle, value); - } - - get { - Matrix m = new Matrix (); - NativeMethods.cairo_pattern_get_matrix (Handle, m); - return m; - } - } - -#pragma warning disable 612 - public IntPtr Handle { - get { return pattern; } - private set { pattern = value; } - } -#pragma warning restore 612 - - [Obsolete] - public IntPtr Pointer { - get { return pattern; } - } - - public PatternType PatternType { - get { return NativeMethods.cairo_pattern_get_type (Handle); } - } - } -} - diff --git a/Crow/src/Mono.Cairo/PatternType.cs b/Crow/src/Mono.Cairo/PatternType.cs deleted file mode 100644 index deac3ab7..00000000 --- a/Crow/src/Mono.Cairo/PatternType.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// Mono.Cairo.PatternType.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - - public enum PatternType - { - Solid, - Surface, - Linear, - Radial, - Mesh, - RasterSource - } -} - diff --git a/Crow/src/Mono.Cairo/PdfSurface.cs b/Crow/src/Mono.Cairo/PdfSurface.cs deleted file mode 100644 index 09a2d126..00000000 --- a/Crow/src/Mono.Cairo/PdfSurface.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// Mono.Cairo.PdfSurface.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - public class PdfSurface : Surface - { - internal PdfSurface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public PdfSurface (string filename, double width, double height) - : base (NativeMethods.cairo_pdf_surface_create (filename, width, height), true) - { - } - - public void SetSize (double width, double height) - { - NativeMethods.cairo_pdf_surface_set_size (Handle, width, height); - } - } -} - diff --git a/Crow/src/Mono.Cairo/Point.cs b/Crow/src/Mono.Cairo/Point.cs deleted file mode 100644 index cf07f311..00000000 --- a/Crow/src/Mono.Cairo/Point.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Mono.Cairo.Context.cs -// -// Author: -// Duncan Mak (duncan@ximian.com) -// Miguel de Icaza (miguel@novell.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// Alp Toker (alp@atoker.com) -// -// (C) Ximian Inc, 2003. -// (C) Novell Inc, 2003. -// -// This is an OO wrapper API for the Cairo API. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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. -// - -namespace Crow.Cairo { - public struct Point - { - public Point (int x, int y) - { - this.x = x; - this.y = y; - } - - int x, y; - public int X { - get { return x; } - set { x = value; } - } - - public int Y { - get { return y; } - set { y = value; } - } - } -} diff --git a/Crow/src/Mono.Cairo/RadialGradient.cs b/Crow/src/Mono.Cairo/RadialGradient.cs deleted file mode 100644 index 6abe2671..00000000 --- a/Crow/src/Mono.Cairo/RadialGradient.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// Mono.Cairo.Pattern.cs -// -// Author: Jordi Mas (jordi@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// (C) Ximian Inc, 2004. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo { - - public class RadialGradient : Gradient - { - internal RadialGradient (IntPtr handle, bool owned) : base (handle, owned) - { - } - - public RadialGradient (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1) - : base (NativeMethods.cairo_pattern_create_radial (cx0, cy0, radius0, cx1, cy1, radius1), true) - { - } - } -} - diff --git a/Crow/src/Mono.Cairo/Region.cs b/Crow/src/Mono.Cairo/Region.cs deleted file mode 100644 index 5e8d8d60..00000000 --- a/Crow/src/Mono.Cairo/Region.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (C) 2011 Novell, Inc (http://www.novell.com) -// -// 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; - -namespace Crow.Cairo -{ - [StructLayout(LayoutKind.Sequential)] - public struct RectangleList { - public Status Status; - public IntPtr Rectangles; - public int NumRectangles; - } - - public enum RegionOverlap { - In, - Out, - Part, - } - - public class Region : IDisposable { - - IntPtr handle; - public IntPtr Handle { - get { return handle; } - } - - [Obsolete] - public Region (IntPtr handle) : this (handle, false) {} - - public Region (IntPtr handle, bool owned) - { - this.handle = handle; - if (!owned) - NativeMethods.cairo_region_reference (handle); - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - public Region () : this (NativeMethods.cairo_region_create () , true) - { - } - - public Region (Crow.Rectangle rect) - { - handle = NativeMethods.cairo_region_create_rectangle (ref rect); - } - - public Region (RectangleList rects) - { - handle = NativeMethods.cairo_region_create_rectangles (rects.Rectangles, rects.NumRectangles); - } - - public Region Copy () - { - return new Region (NativeMethods.cairo_region_copy (Handle), true); - } - - #region IDisposable - ~Region () - { - Dispose (false); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing|| handle == IntPtr.Zero) - return; - - NativeMethods.cairo_region_destroy (Handle); - handle = IntPtr.Zero; - } - #endregion - - public override bool Equals (object obj) - { - return (obj is Region) && NativeMethods.cairo_region_equal (Handle, (obj as Region).Handle); - } - - public override int GetHashCode () - { - return Handle.GetHashCode (); - } - - public Status Status { - get { return NativeMethods.cairo_region_status (Handle); } - } - - public Crow.Rectangle Extents { - get { - Crow.Rectangle result; - NativeMethods.cairo_region_get_extents (Handle, out result); - return result; - } - } - - public int NumRectangles { - get { return NativeMethods.cairo_region_num_rectangles (Handle); } - } - - public Crow.Rectangle GetRectangle (int nth) - { - Crow.Rectangle val; - NativeMethods.cairo_region_get_rectangle (Handle, nth, out val); - return val; - } - - public bool IsEmpty { - get { return NativeMethods.cairo_region_is_empty (Handle); } - } - - public RegionOverlap Contains (Crow.Rectangle rectangle) - { - return NativeMethods.cairo_region_contains_rectangle (Handle, ref rectangle); - } - - public bool Contains (int x, int y) - { - return NativeMethods.cairo_region_contains_point (Handle, x, y); - } - - public void Translate (int dx, int dy) - { - NativeMethods.cairo_region_translate (Handle, dx, dy); - } - - public Status Subtract (Region other) - { - return NativeMethods.cairo_region_subtract (Handle, other.Handle); - } - - public Status SubtractRectangle (Crow.Rectangle rectangle) - { - return NativeMethods.cairo_region_subtract_rectangle (Handle, ref rectangle); - } - - public Status Intersect (Region other) - { - return NativeMethods.cairo_region_intersect (Handle, other.Handle); - } - - public Status IntersectRectangle (Crow.Rectangle rectangle) - { - return NativeMethods.cairo_region_intersect_rectangle (Handle, ref rectangle); - } - - public Status Union (Region other) - { - return NativeMethods.cairo_region_union (Handle, other.Handle); - } - - public Status UnionRectangle (Crow.Rectangle rectangle) - { - return NativeMethods.cairo_region_union_rectangle (Handle, ref rectangle); - } - - public Status Xor (Region other) - { - return NativeMethods.cairo_region_xor (Handle, other.Handle); - } - - public Status XorRectangle (Crow.Rectangle rectangle) - { - return NativeMethods.cairo_region_xor_rectangle (Handle, ref rectangle); - } - } -} diff --git a/Crow/src/Mono.Cairo/ScaledFont.cs b/Crow/src/Mono.Cairo/ScaledFont.cs deleted file mode 100644 index 594d1be9..00000000 --- a/Crow/src/Mono.Cairo/ScaledFont.cs +++ /dev/null @@ -1,123 +0,0 @@ -// -// Mono.Cairo.ScaledFont.cs -// -// (c) 2008 Jordi Mas i Hernandez (jordimash@gmail.com) -// -// 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; - -namespace Crow.Cairo { - - public class ScaledFont : IDisposable - { - protected IntPtr handle = IntPtr.Zero; - - internal ScaledFont (IntPtr handle, bool owner) - { - this.handle = handle; - if (!owner) - NativeMethods.cairo_scaled_font_reference (handle); - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - public ScaledFont (FontFace fontFace, Matrix matrix, Matrix ctm, FontOptions options) - : this (NativeMethods.cairo_scaled_font_create (fontFace.Handle, matrix, ctm, options.Handle), true) - { - } - - ~ScaledFont () - { - Dispose (false); - } - - public IntPtr Handle { - get { - return handle; - } - } - - public FontExtents FontExtents { - get { - FontExtents extents; - NativeMethods.cairo_scaled_font_extents (handle, out extents); - return extents; - } - } - - public Matrix FontMatrix { - get { - Matrix m; - NativeMethods.cairo_scaled_font_get_font_matrix (handle, out m); - return m; - } - } - - public FontType FontType { - get { - return NativeMethods.cairo_scaled_font_get_type (handle); - } - } - - public TextExtents GlyphExtents (Glyph[] glyphs) - { - IntPtr ptr = Context.FromGlyphToUnManagedMemory (glyphs); - TextExtents extents; - - NativeMethods.cairo_scaled_font_glyph_extents (handle, ptr, glyphs.Length, out extents); - - Marshal.FreeHGlobal (ptr); - return extents; - } - - public Status Status - { - get { return NativeMethods.cairo_scaled_font_status (handle); } - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing|| handle == IntPtr.Zero) - return; - - NativeMethods.cairo_scaled_font_destroy (handle); - handle = IntPtr.Zero; - } - - [Obsolete] - protected void Reference () - { - NativeMethods.cairo_scaled_font_reference (handle); - } - } -} - diff --git a/Crow/src/Mono.Cairo/SolidPattern.cs b/Crow/src/Mono.Cairo/SolidPattern.cs deleted file mode 100644 index 6cd89f85..00000000 --- a/Crow/src/Mono.Cairo/SolidPattern.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Mono.Cairo.Pattern.cs -// -// Author: Jordi Mas (jordi@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// (C) Ximian Inc, 2004. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Color = Crow.Color; -namespace Crow.Cairo { - - public class SolidPattern : Pattern - { - internal SolidPattern (IntPtr handle, bool owned) : base (handle, owned) - { - } - - public SolidPattern (Color color) - : base (NativeMethods.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A), true) - { - } - - public SolidPattern (double r, double g, double b) - : base (NativeMethods.cairo_pattern_create_rgb (r, g, b), true) - { - } - - public SolidPattern (double r, double g, double b, double a) - : base (NativeMethods.cairo_pattern_create_rgba (r, g, b, a), true) - { - } - - public SolidPattern (Color color, bool solid) - : base (solid - ? NativeMethods.cairo_pattern_create_rgb (color.R, color.G, color.B) - : NativeMethods.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A), - true) - { - } - - public Color Color { - get { - double red, green, blue, alpha; - NativeMethods.cairo_pattern_get_rgba (Handle, out red, out green, out blue, out alpha); - return new Color (red, green, blue, alpha); - } - } - } -} - diff --git a/Crow/src/Mono.Cairo/Status.cs b/Crow/src/Mono.Cairo/Status.cs deleted file mode 100644 index 2df15580..00000000 --- a/Crow/src/Mono.Cairo/Status.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Mono.Cairo.Status.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// John Luke (john.luke@gmail.com) -// Alp Toker (alp@atoker.com) -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2005 John Luke -// -// 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 Crow.Cairo -{ - - public enum Status - { - Success = 0, - NoMemory, - InvalidRestore, - InvalidPopGroup, - NoCurrentPoint, - InvalidMatrix, - InvalidStatus, - NullPointer, - InvalidString, - InvalidPathData, - ReadError, - WriteError, - SurfaceFinished, - SurfaceTypeMismatch, - PatternTypeMismatch, - InvalidContent, - InvalidFormat, - InvalidVisual, - FileNotFound, - InvalidDash, - InvalidDscComment, - InvalidIndex, - ClipNotRepresentable, - } -} diff --git a/Crow/src/Mono.Cairo/SubpixelOrder.cs b/Crow/src/Mono.Cairo/SubpixelOrder.cs deleted file mode 100644 index 95f3cbee..00000000 --- a/Crow/src/Mono.Cairo/SubpixelOrder.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// Mono.Cairo.Cairo.cs -// -// Authors: -// John Luke (john.luke@gmail.com) -// -// Copyright (C) John Luke 2005 -// -// 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 Crow.Cairo -{ - - public enum SubpixelOrder - { - Default, - Rgb, - Bgr, - Vrgb, - Vbgr, - } -} diff --git a/Crow/src/Mono.Cairo/Surface.cs b/Crow/src/Mono.Cairo/Surface.cs deleted file mode 100644 index 88ebb107..00000000 --- a/Crow/src/Mono.Cairo/Surface.cs +++ /dev/null @@ -1,233 +0,0 @@ -// -// Mono.Cairo.Surface.cs -// -// Authors: -// Duncan Mak -// Miguel de Icaza. -// Alp Toker -// -// (C) Ximian Inc, 2003. -// (C) Novell, Inc. 2003. -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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.Collections; - -namespace Crow.Cairo { - - public class Surface : IDisposable - { - IntPtr handle = IntPtr.Zero; - - [Obsolete] - protected Surface() - { - } - - [Obsolete] - protected Surface (IntPtr ptr) : this (ptr, true) - { - } - - protected Surface (IntPtr handle, bool owner) - { - this.handle = handle; - if (!owner) - NativeMethods.cairo_surface_reference (handle); - if (CairoDebug.Enabled) - CairoDebug.OnAllocated (handle); - } - - public static Surface Lookup (IntPtr surface, bool owned) - { - SurfaceType st = NativeMethods.cairo_surface_get_type (surface); - switch (st) { - case SurfaceType.Image: - return new ImageSurface (surface, owned); - case SurfaceType.Xlib: - return new XlibSurface (surface, owned); - case SurfaceType.Xcb: - return new XcbSurface (surface, owned); - case SurfaceType.Glitz: - return new GlitzSurface (surface, owned); - case SurfaceType.Win32: - return new Win32Surface (surface, owned); - case SurfaceType.Pdf: - return new PdfSurface (surface, owned); - case SurfaceType.PS: - return new PSSurface (surface, owned); - case SurfaceType.DirectFB: - return new DirectFBSurface (surface, owned); - case SurfaceType.Svg: - return new SvgSurface (surface, owned); - case SurfaceType.GL: - return new GLSurface (surface, owned); - default: - return new Surface (surface, owned); - } - } - - [Obsolete ("Use an ImageSurface constructor instead.")] - public static Crow.Cairo.Surface CreateForImage ( - ref byte[] data, Crow.Cairo.Format format, int width, int height, int stride) - { - IntPtr p = NativeMethods.cairo_image_surface_create_for_data ( - data, format, width, height, stride); - - return new Crow.Cairo.Surface (p, true); - } - - [Obsolete ("Use an ImageSurface constructor instead.")] - public static Crow.Cairo.Surface CreateForImage ( - Crow.Cairo.Format format, int width, int height) - { - IntPtr p = NativeMethods.cairo_image_surface_create ( - format, width, height); - - return new Crow.Cairo.Surface (p, true); - } - - - public Crow.Cairo.Surface CreateSimilar ( - Crow.Cairo.Content content, int width, int height) - { - IntPtr p = NativeMethods.cairo_surface_create_similar ( - this.Handle, content, width, height); - - return Surface.Lookup(p, true); - } - - ~Surface () - { - Dispose (false); - } - - //[Obsolete ("Use Context.SetSource() followed by Context.Paint()")] - public void Show (Context gr, double x, double y) - { - NativeMethods.cairo_set_source_surface (gr.Handle, handle, x, y); - NativeMethods.cairo_paint (gr.Handle); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposing || CairoDebug.Enabled) - CairoDebug.OnDisposed (handle, disposing); - - if (!disposing|| handle == IntPtr.Zero) - return; - - NativeMethods.cairo_surface_destroy (handle); - handle = IntPtr.Zero; - } - public virtual void SetSize (int width, int height) { - } - - public Status Finish () - { - NativeMethods.cairo_surface_finish (handle); - return Status; - } - - public void Flush () - { - NativeMethods.cairo_surface_flush (handle); - } - - public void MarkDirty () - { - NativeMethods.cairo_surface_mark_dirty (Handle); - } - - public void MarkDirty (Crow.Rectangle rectangle) - { - NativeMethods.cairo_surface_mark_dirty_rectangle (Handle, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); - } - - public IntPtr Handle { - get { - return handle; - } - } - - public PointD DeviceOffset { - get { - double x, y; - NativeMethods.cairo_surface_get_device_offset (handle, out x, out y); - return new PointD (x, y); - } - - set { - NativeMethods.cairo_surface_set_device_offset (handle, value.X, value.Y); - } - } - - [Obsolete ("Use Dispose()")] - public void Destroy() - { - Dispose (); - } - - public void SetFallbackResolution (double x, double y) - { - NativeMethods.cairo_surface_set_fallback_resolution (handle, x, y); - } - - public void WriteToPng (string filename) - { - NativeMethods.cairo_surface_write_to_png (handle, filename); - } - - [Obsolete ("Use Handle instead.")] - public IntPtr Pointer { - get { - return handle; - } - } - - public Status Status { - get { return NativeMethods.cairo_surface_status (handle); } - } - - public Content Content { - get { return NativeMethods.cairo_surface_get_content (handle); } - } - - public SurfaceType SurfaceType { - get { return NativeMethods.cairo_surface_get_type (handle); } - } - - public uint ReferenceCount { - get { return NativeMethods.cairo_surface_get_reference_count (handle); } - } - } -} diff --git a/Crow/src/Mono.Cairo/SurfacePattern.cs b/Crow/src/Mono.Cairo/SurfacePattern.cs deleted file mode 100644 index 53a90d38..00000000 --- a/Crow/src/Mono.Cairo/SurfacePattern.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Mono.Cairo.Pattern.cs -// -// Author: Jordi Mas (jordi@ximian.com) -// Hisham Mardam Bey (hisham.mardambey@gmail.com) -// (C) Ximian Inc, 2004. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo { - - public class SurfacePattern : Pattern - { - internal SurfacePattern (IntPtr handle, bool owned) : base (handle, owned) - { - } - - public SurfacePattern (Surface surface) - : base (NativeMethods.cairo_pattern_create_for_surface (surface.Handle), true) - { - } - - //no idea why this is here, the base one is identical, but we can't remove it now - public new Extend Extend { - set { NativeMethods.cairo_pattern_set_extend (Handle, value); } - get { return NativeMethods.cairo_pattern_get_extend (Handle); } - } - - public Filter Filter { - set { NativeMethods.cairo_pattern_set_filter (Handle, value); } - get { return NativeMethods.cairo_pattern_get_filter (Handle); } - } - } -} - diff --git a/Crow/src/Mono.Cairo/SurfaceType.cs b/Crow/src/Mono.Cairo/SurfaceType.cs deleted file mode 100644 index bd992db0..00000000 --- a/Crow/src/Mono.Cairo/SurfaceType.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Mono.Cairo.SurfaceType.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - - public enum SurfaceType - { - Image, - Pdf, - PS, - Xlib, - Xcb, - Glitz, - Quartz, - Win32, - BeOS, - DirectFB, - Svg, - OS2, - Win32Printing, - QuartzImage, - Script, - Qt, - Recording, - VG, - GL, - Drm, - Tee, - Xml, - Skia, - SubSurface - } -} diff --git a/Crow/src/Mono.Cairo/SvgSurface.cs b/Crow/src/Mono.Cairo/SvgSurface.cs deleted file mode 100644 index c7d72988..00000000 --- a/Crow/src/Mono.Cairo/SvgSurface.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// Mono.Cairo.SvgSurface.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - public class SvgSurface : Surface - { - internal SvgSurface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public SvgSurface (string filename, double width, double height) - : base (NativeMethods.cairo_svg_surface_create (filename, width, height), true) - { - } - - public void RestrictToVersion (SvgVersion version) - { - NativeMethods.cairo_svg_surface_restrict_to_version (Handle, version); - } - } -} - diff --git a/Crow/src/Mono.Cairo/SvgVersion.cs b/Crow/src/Mono.Cairo/SvgVersion.cs deleted file mode 100644 index 916fb861..00000000 --- a/Crow/src/Mono.Cairo/SvgVersion.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Mono.Cairo.SvgVersion.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - - public enum SvgVersion - { - // FIXME: yuck - OnePointOne = 0, - OnePointTwo, - } -} - diff --git a/Crow/src/Mono.Cairo/WGLDevice.cs b/Crow/src/Mono.Cairo/WGLDevice.cs deleted file mode 100644 index 308cfadd..00000000 --- a/Crow/src/Mono.Cairo/WGLDevice.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Mono.Cairo.Device.cs -// -// Authors: -// JP Bruyère (jp_bruyere@hotmail.com) -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2016 JP 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 Crow.Cairo -{ - public class WGLDevice : Device - { - public WGLDevice (IntPtr hglrc) : base (NativeMethods.cairo_wgl_device_create (hglrc), true) - { - } - - public IntPtr Context { - get { return NativeMethods.cairo_wgl_device_get_context (Handle); } - } - } -} - diff --git a/Crow/src/Mono.Cairo/Win32Surface.cs b/Crow/src/Mono.Cairo/Win32Surface.cs deleted file mode 100644 index 4776a19b..00000000 --- a/Crow/src/Mono.Cairo/Win32Surface.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// Mono.Cairo.Win32Surface.cs -// -// Authors: -// John Luke -// -// (C) John Luke, 2006. -// -// 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 Crow.Cairo { - - public class Win32Surface : Surface - { - internal Win32Surface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public Win32Surface (IntPtr hdc) - : base (NativeMethods.cairo_win32_surface_create (hdc), true) - { - } - } -} diff --git a/Crow/src/Mono.Cairo/XcbSurface.cs b/Crow/src/Mono.Cairo/XcbSurface.cs deleted file mode 100644 index 32a67848..00000000 --- a/Crow/src/Mono.Cairo/XcbSurface.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Mono.Cairo.XcbSurface.cs -// -// Authors: -// Alp Toker -// -// (C) Alp Toker, 2006. -// -// 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 Crow.Cairo { - public class XcbSurface : Surface - { - internal XcbSurface (IntPtr handle, bool owns) : base (handle, owns) - { - } - - public XcbSurface (IntPtr connection, uint drawable, IntPtr visual, int width, int height) - : base (NativeMethods.cairo_xcb_surface_create (connection, drawable, visual, width, height), true) - { - } - - public static XcbSurface FromBitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height) - { - IntPtr ptr = NativeMethods.cairo_xcb_surface_create_for_bitmap (connection, bitmap, screen, width, height); - return new XcbSurface (ptr, true); - } - public override void SetSize (int width, int height) - { - NativeMethods.cairo_xcb_surface_set_size (Handle, width, height); - } - } -} diff --git a/Crow/src/Mono.Cairo/XlibSurface.cs b/Crow/src/Mono.Cairo/XlibSurface.cs deleted file mode 100644 index 186024e9..00000000 --- a/Crow/src/Mono.Cairo/XlibSurface.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// Mono.Cairo.XlibSurface.cs -// -// Authors: -// Duncan Mak -// Miguel de Icaza. -// -// (C) Ximian Inc, 2003. -// (C) Novell, Inc. 2003. -// -// This is an OO wrapper API for the Cairo API -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// 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 Crow.Cairo { - - public class XlibSurface : Surface - { - public XlibSurface (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height) - : base (NativeMethods.cairo_xlib_surface_create (display, drawable, visual, width, height), true) - { - } - - public XlibSurface (IntPtr ptr, bool own) : base (ptr, own) - { - } - - public static XlibSurface FromBitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height) - { - IntPtr ptr = NativeMethods.cairo_xlib_surface_create_for_bitmap (display, bitmap, screen, width, height); - return new XlibSurface(ptr, true); - } - - public void SetDrawable (IntPtr drawable, int width, int height) - { - NativeMethods.cairo_xlib_surface_set_drawable (Handle, drawable, width, height); - } - - public void SetSize (int width, int height) - { - NativeMethods.cairo_xlib_surface_set_size (Handle, width, height); - } - - public int Depth { - get { return NativeMethods.cairo_xlib_surface_get_depth (Handle); } - } - - public IntPtr Display { - get { return NativeMethods.cairo_xlib_surface_get_display (Handle); } - } - - public IntPtr Drawable { - get { return NativeMethods.cairo_xlib_surface_get_drawable (Handle); } - } - - public int Height { - get { return NativeMethods.cairo_xlib_surface_get_height (Handle); } - } - - public IntPtr Screen { - get { return NativeMethods.cairo_xlib_surface_get_screen (Handle); } - } - - public IntPtr Visual { - get { return NativeMethods.cairo_xlib_surface_get_visual (Handle); } - } - - public int Width { - get { return NativeMethods.cairo_xlib_surface_get_width (Handle); } - } - - } -} diff --git a/Crow/src/MouseCursorChangedEventArgs.cs b/Crow/src/MouseCursorChangedEventArgs.cs index 9c63c11f..850ee9c2 100644 --- a/Crow/src/MouseCursorChangedEventArgs.cs +++ b/Crow/src/MouseCursorChangedEventArgs.cs @@ -28,12 +28,12 @@ using System; namespace Crow { - public class MouseCursorChangedEventArgs : EventArgs - { - public XCursor NewCursor; - public MouseCursorChangedEventArgs (XCursor newCursor) : base() - { - NewCursor = newCursor; - } - } + //public class MouseCursorChangedEventArgs : EventArgs + //{ + // public XCursor NewCursor; + // public MouseCursorChangedEventArgs (XCursor newCursor) : base() + // { + // NewCursor = newCursor; + // } + //} } diff --git a/Crow/src/Picture.cs b/Crow/src/Picture.cs index 133bc4ef..2b8c2804 100644 --- a/Crow/src/Picture.cs +++ b/Crow/src/Picture.cs @@ -26,7 +26,7 @@ using System; using System.IO; -using Crow.Cairo; +using vkvg; using System.Collections.Generic; namespace Crow diff --git a/Crow/src/Point.cs b/Crow/src/Point.cs index de9df7c8..27f96589 100644 --- a/Crow/src/Point.cs +++ b/Crow/src/Point.cs @@ -58,17 +58,25 @@ namespace Crow public double LengthD { get { return Math.Sqrt (Math.Pow (_x, 2) + Math.Pow (_y, 2)); } } - public static implicit operator Crow.Cairo.Point(Point p) + //public static implicit operator Crow.Cairo.Point(Point p) + //{ + // return new Crow.Cairo.Point(p.X, p.Y); + //} + //public static implicit operator Crow.Cairo.PointD(Point p) + //{ + // return new Crow.Cairo.PointD(p.X, p.Y); + //} + public static implicit operator Point(int i) { - return new Crow.Cairo.Point(p.X, p.Y); + return new Point(i, i); } - public static implicit operator Crow.Cairo.PointD(Point p) + public static implicit operator Point(vkvg.PointD p) { - return new Crow.Cairo.PointD(p.X, p.Y); + return new Point((int)p.X, (int)p.Y); } - public static implicit operator Point(int i) + public static implicit operator vkvg.PointD(Point p) { - return new Point(i, i); + return new vkvg.PointD(p.X, p.Y); } public static Point operator /(Point p, int d) { diff --git a/Crow/src/Rectangle.cs b/Crow/src/Rectangle.cs index b5934157..4ee7c8a6 100644 --- a/Crow/src/Rectangle.cs +++ b/Crow/src/Rectangle.cs @@ -25,9 +25,6 @@ // THE SOFTWARE. using System; -using System.Collections.Generic; -using System.Text; -using System.Xml.Serialization; using System.Runtime.InteropServices; namespace Crow diff --git a/Crow/src/Rectangles.cs b/Crow/src/Rectangles.cs index c915ac44..e53b42ca 100644 --- a/Crow/src/Rectangles.cs +++ b/Crow/src/Rectangles.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System.Collections.Generic; -using Crow.Cairo; +using vkvg; namespace Crow { public class Rectangles diff --git a/Crow/src/SolidColor.cs b/Crow/src/SolidColor.cs index f14c7cf7..c19e7495 100644 --- a/Crow/src/SolidColor.cs +++ b/Crow/src/SolidColor.cs @@ -31,7 +31,7 @@ using System.Text; using System.Xml.Serialization; using System.Reflection; using System.Diagnostics; -using Crow.Cairo; +using vkvg; @@ -51,7 +51,7 @@ namespace Crow public override void SetAsSource (Context ctx, Rectangle bounds = default(Rectangle)) { - ctx.SetSourceRGBA (color.R, color.G, color.B, color.A); + ctx.SetSourceColor (color); } public static object Parse(string s) { diff --git a/Crow/src/SvgPicture.cs b/Crow/src/SvgPicture.cs index 33f68955..cf7c39b0 100644 --- a/Crow/src/SvgPicture.cs +++ b/Crow/src/SvgPicture.cs @@ -26,7 +26,7 @@ using System; using System.IO; -using Crow.Cairo; +using vkvg; namespace Crow { @@ -96,16 +96,16 @@ namespace Crow widthRatio = heightRatio; } - using (ImageSurface tmp = new ImageSurface (Format.Argb32, bounds.Width, bounds.Height)) { - using (Context gr = new Context (tmp)) { - gr.Translate (bounds.Left, bounds.Top); - gr.Scale (widthRatio, heightRatio); - gr.Translate ((bounds.Width/widthRatio - Dimensions.Width)/2, (bounds.Height/heightRatio - Dimensions.Height)/2); + //using (ImageSurface tmp = new ImageSurface (Format.Argb32, bounds.Width, bounds.Height)) { + // using (Context gr = new Context (tmp)) { + // gr.Translate (bounds.Left, bounds.Top); + // gr.Scale (widthRatio, heightRatio); + // gr.Translate ((bounds.Width/widthRatio - Dimensions.Width)/2, (bounds.Height/heightRatio - Dimensions.Height)/2); - hSVG.RenderCairo (gr); - } - ctx.SetSource (tmp); - } + // hSVG.RenderCairo (gr); + // } + // ctx.SetSource (tmp); + //} } #endregion diff --git a/Crow/src/backends/IBackend.cs b/Crow/src/backends/IBackend.cs deleted file mode 100644 index f33dd8f8..00000000 --- a/Crow/src/backends/IBackend.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// IBackend.cs -// -// Author: -// Jean-Philippe Bruyère -// -// 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 Crow -{ - public enum MouseCursors - { - Default, - Cross, - Arrow, - Text, - SW, - SE, - NW, - NE, - N, - S, - V, - H, - MaxEnum, - } - public interface IBackend - { - void Init(Interface iFace); - void CleanUp(); - void Flush(); - void ProcessEvents(); - - void SetCursor (MouseCursors newCur); - void SetCursorPosition (int x, int y); - - bool IsDown (Key key); - bool Shift { get; } - bool Ctrl { get; } - bool Alt { get; } - } -} - diff --git a/Crow/src/backends/IKeyboard.cs b/Crow/src/backends/IKeyboard.cs deleted file mode 100644 index d04655e2..00000000 --- a/Crow/src/backends/IKeyboard.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// IKeyboard.cs -// -// Author: -// Jean-Philippe Bruyère -// -// 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 Crow -{ - public interface IKeyboard - { - event EventHandler KeyDown; - event EventHandler KeyUp; - event EventHandler KeyPress; - - - void HandleEvent (uint Keycode, bool pressed); - - bool IsDown (Key key); - bool Shift { get; } - bool Ctrl { get; } - bool Alt { get; } - - void Destroy (); - } -} - diff --git a/Crow/src/backends/win32/User32/Cursor.cs b/Crow/src/backends/win32/User32/Cursor.cs deleted file mode 100644 index f324d574..00000000 --- a/Crow/src/backends/win32/User32/Cursor.cs +++ /dev/null @@ -1,170 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Security; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with the cursor. - /// - public static class Cursor - { - /// - /// Loads the specified cursor resource from a set of pre-defined cursors (see ). - /// - /// An identifier for one of the pre-defined cursors. - /// - /// If the function succeeds, the return value is the handle to the newly loaded cursor. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - public static IntPtr LoadCursor(CursorName cursorName) - => LoadCursor(IntPtr.Zero, (int)cursorName); - - /// - /// Loads the specified cursor resource from the executable (.EXE) file associated - /// with an application instance. - /// - /// - /// A handle to an instance of the module whose executable file contains the cursor to be loaded. - /// - /// The name of the cursor resource to be loaded. - /// - /// If the function succeeds, the return value is the handle to the newly loaded cursor. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - public static extern IntPtr LoadCursor - ( - [In] IntPtr moduleInstance, - [In] string cursorName - ); - - /// - /// Loads the specified cursor resource from a set of pre-defined cursors (see ). - /// - /// Usually a handle to an instance, but null in this overload. - /// - /// An integer consisting of the resource identifier in the low-order word and zero in the high-order word. - /// - /// - /// If the function succeeds, the return value is the handle to the newly loaded cursor. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - private static extern IntPtr LoadCursor - ( - [In] [Optional] IntPtr moduleInstance, - [In] int cursorIdentifier - ); - - /// - /// Confines the cursor to a rectangular area on the screen. If a subsequent cursor position - /// (set by the function or the mouse) lies outside the rectangle, - /// the system automatically adjusts the position to keep the cursor inside the rectangular area. - /// - /// - /// A pointer to the structure that contains the screen coordinates of the upper-left and lower-right - /// corners of the confining rectangle. If this parameter is null, - /// the cursor is free to move anywhere on the screen. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ClipCursor([In] [Optional] ref Rect rect); - - /// - /// Confines the cursor to a rectangular area on the screen. If a subsequent cursor position - /// (set by the function or the mouse) lies outside the rectangle, - /// the system automatically adjusts the position to keep the cursor inside the rectangular area. - /// - /// - /// A pointer to the structure that contains the screen coordinates of the upper-left and lower-right - /// corners of the confining rectangle. If this parameter is null, - /// the cursor is free to move anywhere on the screen. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ClipCursor([In] [Optional] IntPtr rect); - - /// - /// Displays or hides the cursor. - /// - /// - /// If true, the display count is incremented by one. If false, the display count is decremented by one. - /// - /// The return value specifies the new display counter. - [DllImport(Library)] - public static extern int ShowCursor([In] bool show); - - /// - /// Retrieves the cursor's position, in screen coordinates. - /// - /// - /// A pointer to a structure that receives the screen coordinates of the cursor. - /// - /// - /// Returns true if successful or false otherwise. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [SuppressUnmanagedCodeSecurity] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetCursorPos([Out] out Point point); - - /// - /// Moves the cursor to the specified screen coordinates. If the new coordinates are not within the - /// screen rectangle set by the most recent function call, the system - /// automatically adjusts the coordinates so that the cursor stays within the rectangle. - /// - /// The new x-coordinate of the cursor, in screen coordinates. - /// The new y-coordinate of the cursor, in screen coordinates. - /// - /// Returns true if successful or false otherwise. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool SetCursorPos([In] int x, [In] int y); - - /// - /// Retrieves a handle to the current cursor. - /// - /// - /// The return value is the handle to the current cursor. If there is - /// no cursor, the return value is null. - /// - [DllImport(Library)] - public static extern IntPtr GetCursor(); - - /// - /// Sets the cursor shape. - /// - /// - /// A handle to the cursor. The cursor must have been created by the CreateCursor function or loaded by - /// the or LoadImage function. If this parameter is null, - /// the cursor is removed from the screen. - /// - /// - /// The return value is the handle to the previous cursor, if there was one. - /// If there was no previous cursor, the return value is null. - /// - [DllImport(Library)] - public static extern IntPtr SetCursor([In] [Optional] IntPtr cursor); - } - } -} diff --git a/Crow/src/backends/win32/User32/Delegates/TimerProc.cs b/Crow/src/backends/win32/User32/Delegates/TimerProc.cs deleted file mode 100644 index 765e326e..00000000 --- a/Crow/src/backends/win32/User32/Delegates/TimerProc.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// An application-defined callback function that processes messages. TimerProc - /// is a placeholder for the application-defined function name. - /// - /// A handle to the window associated with the timer. - /// The message. - /// The timer's identifier. - /// - /// The number of milliseconds that have elapsed since the system was started. This is the - /// value returned by the GetTickCount function. - /// - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - public delegate void TimerProc - ( - [In] IntPtr hwnd, - [In] WindowMessage msg, - [In] UIntPtr timerID, - [In] uint elapsedTime - ); -} diff --git a/Crow/src/backends/win32/User32/Delegates/WindowProc.cs b/Crow/src/backends/win32/User32/Delegates/WindowProc.cs deleted file mode 100644 index e3cc1932..00000000 --- a/Crow/src/backends/win32/User32/Delegates/WindowProc.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Security; - -namespace OpenToolkit.NT.Native -{ - /// - /// An application-defined function that processes messages sent to a window. WindowProc is a placeholder for the - /// application-defined function name. - /// - /// A handle to the window. - /// The message. - /// - /// Additional message information. The contents of this parameter depend on the value of the - /// parameter. - /// - /// - /// Additional message information. The contents of this parameter depend on the value of the - /// parameter. - /// - /// The return value is the result of the message processing and depends on the message sent. - [SuppressUnmanagedCodeSecurity] - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - public delegate IntPtr WindowProc - ( - [In] IntPtr hwnd, - [In] WindowMessage msg, - [In] IntPtr wparam, - [In] IntPtr lparam - ); -} diff --git a/Crow/src/backends/win32/User32/Device.cs b/Crow/src/backends/win32/User32/Device.cs deleted file mode 100644 index 9a4bea35..00000000 --- a/Crow/src/backends/win32/User32/Device.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with devices. - /// - public static class Device - { - /// - /// Registers the device or type of device for which a window will receive notifications. - /// - /// - /// A handle to the window or service that will receive device events for the devices specified in the - /// parameter. The same window handle can be used in multiple calls - /// to . - /// Services can specify either a window handle or service status handle. - /// - /// - /// A pointer to a block of data that specifies the type of device for which notifications should be sent. - /// This block always begins with the DEV_BROADCAST_HDR structure. The data following this header is - /// dependent on the value of the dbch_devicetype member, which can be - /// or . - /// For more information, see the Remarks section in the official documentation. - /// - /// Specifies additional information for this function call. - /// - /// If the function succeeds, the return value is a device notification handle. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - public static extern IntPtr RegisterDeviceNotification - ( - [In] IntPtr recipient, - [In] IntPtr notificationFilter, - [In] DeviceNotificationEnum flags - ); - - /// - /// Closes the specified device notification handle. - /// - /// - /// Device notification handle returned by the - /// function. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool UnregisterDeviceNotification([In] IntPtr handle); - } - } -} diff --git a/Crow/src/backends/win32/User32/DeviceContext.cs b/Crow/src/backends/win32/User32/DeviceContext.cs deleted file mode 100644 index e1d2a5d5..00000000 --- a/Crow/src/backends/win32/User32/DeviceContext.cs +++ /dev/null @@ -1,213 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with device contexts. - /// - public static class DeviceContext - { - /// - /// Retrieves a handle to a device context (DC) for the client area - /// of a specified window or for the entire screen. - /// - /// - /// A handle to the window whose DC is to be retrieved. - /// If this value is , the DC for the entire screen is retrieved. - /// - /// - /// If the function succeeds, the return value is a handle - /// to the DC for the specified window's client area. - /// If the function fails, the return value is . - /// - [DllImport(Library)] - public static extern IntPtr GetDC([In] [Optional] IntPtr window); - - /// - /// Releases a device context (DC), freeing it for use by other applications. The effect of this function - /// depends on the type of DC. - /// It frees only common and window DCs. It has no effect on class or private DCs. - /// - /// A handle to the window whose DC is to be released. - /// A handle to the DC to be released. - /// - /// The return value indicates whether the DC was released. - /// If the DC was released, the return value is true. - /// If the DC was not released, the return value is false. - /// - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ReleaseDC([In] IntPtr window, [In] IntPtr dc); - - /// - /// Changes the settings of the default display device to the specified graphics mode. - /// To change the settings of a specified display device, use the - /// - /// function. - /// - /// - /// A structure that describes the new graphics mode. If - /// is , all the values currently in the registry - /// will be used for the display setting. Passing for the - /// parameter and 0 for the parameter is the - /// easiest way to return to the default mode after a dynamic mode change. - /// - /// Indicates how the graphics mode should be changed. - /// - /// A indicating the status of the change operation. - /// - [DllImport(Library)] - public static extern ChangeDisplaySettingsResult ChangeDisplaySettings - ( - [In] ref DeviceMode deviceMode, - [In] DisplaySettingsChanges changeFlags - ); - - /// - /// Changes the settings of the specified display device to the specified graphics mode. - /// - /// - /// A string that specifies the display device whose graphics mode will change. - /// Only display device names as returned by - /// are valid. - /// - /// - /// A structure that describes the new graphics mode. If - /// is , all the values currently in the registry - /// will be used for the display setting. Passing for the - /// parameter and 0 for the parameter is the - /// easiest way to return to the default mode after a dynamic mode change. - /// - /// Reserved, must be null. - /// Indicates how the graphics mode should be changed. - /// - /// If is , this - /// parameter is a pointer to a VIDEOPARAMETERS structure. - /// Otherwise must be NULL. - /// - /// - /// A indicating the status of the change operation. - /// - [DllImport(Library, CharSet = CharSet.Unicode)] - public static extern ChangeDisplaySettingsResult ChangeDisplaySettingsEx - ( - [In] [Optional] string deviceName, - [In] [Optional] IntPtr deviceMode, - [Optional] IntPtr window, - [In] DisplaySettingsChanges changeFlags, - [In] IntPtr changeParams - ); - - /// - /// Retrieves information about one of the graphics modes for a display device. To retrieve information - /// for all the graphics modes of a display device, make a series of calls to this function. - /// - /// - /// A string that specifies the display device about whose graphics mode the function - /// will obtain information. - /// This parameter is either null or a returned from - /// . A null value specifies the - /// current display device on the computer on which the calling thread is running. - /// - /// Specifies the type of information to be retrieved. - /// - /// A structure into which the function stores information about the specified - /// graphics mode. Before calling - /// , set the - /// member to , - /// and set the member to indicate the size, in bytes, - /// of the additional space available to receive private driver data. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// - [DllImport(Library, CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool EnumDisplaySettings - ( - [In] string deviceName, - [In] DisplayModeSetting modeSetting, - [Out] out DeviceMode deviceMode - ); - - /// - /// Retrieves information about one of the graphics modes for a display device. To retrieve information - /// for all the graphics modes of a display device, make a series of calls to this function. - /// - /// - /// A string that specifies the display device about whose graphics mode the function - /// will obtain information. - /// This parameter is either null or a returned from - /// . A null value specifies the - /// current display device on the computer on which the calling thread is running. - /// - /// Specifies the type of information to be retrieved. - /// - /// A structure into which the function stores information about the specified - /// graphics mode. Before calling - /// , set the - /// member to , - /// and set the member to indicate the size, in bytes, - /// of the additional space available to receive private driver data. - /// - /// - /// Sets constraints on which graphics modes to return for the given display device. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// - [DllImport(Library, CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool EnumDisplaySettingsEx - ( - [In] string deviceName, - [In] DisplayModeSetting modeSetting, - [Out] out DeviceMode deviceMode, - [In] EnumDisplayModes displayModeFlags - ); - - /// - /// Obtains information about the display devices in the current session. - /// - /// - /// A pointer to the device name. If NULL, function returns information for the display adapter(s) - /// on the machine, based on . - /// - /// An index value that specifies the display device of interest. - /// - /// A structure that receives information about the display device - /// specified by . - /// Before calling , you must - /// initialize the member of - /// to . - /// - /// - /// Set this to 1 to retrieve the device interface name for GUID_DEVINTERFACE_MONITOR, which is registered - /// by the operating system on a per monitor basis. The value is placed in the - /// member in . The resulting device - /// interface name can be used with SetupAPI functions and serves as a link between GDI monitor - /// devices and SetupAPI monitor devices. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// The function fails if is greater than the largest device index. - /// - [DllImport(Library, CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool EnumDisplayDevices - ( - [In] [Optional] string deviceName, - [In] uint deviceIndex, - [Out] out DisplayDevice displayDevice, - [In] uint flags - ); - } - } -} diff --git a/Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs b/Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs deleted file mode 100644 index 89e2b397..00000000 --- a/Crow/src/backends/win32/User32/Enums/ChangeDisplaySettingsResult.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used in - /// and to indicate the result of the function call. - /// - public enum ChangeDisplaySettingsResult : int - { - /// - /// The settings change was successful. - /// - Successful = 0, - - /// - /// The computer must be restarted for the graphics mode to work. - /// - Restart = 1, - - /// - /// The display driver failed the specified graphics mode. - /// - Failed = -1, - - /// - /// The graphics mode is not supported. - /// - BadMode = -2, - - /// - /// Unable to write settings to the registry. - /// - NotUpdated = -3, - - /// - /// An invalid set of flags was passed in. - /// - BadFlags = -4, - - /// - /// An invalid parameter was passed in. This can include an invalid flag or combination of flags. - /// - BadParam = -5, - - /// - /// The settings change was unsuccessful because the system is DualView capable. - /// Only supported on XP and higher. - /// - BadDualView = -6, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/CursorName.cs b/Crow/src/backends/win32/User32/Enums/CursorName.cs deleted file mode 100644 index c8aac66f..00000000 --- a/Crow/src/backends/win32/User32/Enums/CursorName.cs +++ /dev/null @@ -1,88 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies resource identifiers for the pre-defined cursors. - /// - public enum CursorName - { - /// - /// Standard arrow and small hourglass. - /// - AppStarting = 32650, - - /// - /// Standard arrow. - /// - Arrow = 32512, - - /// - /// Crosshair. - /// - Cross = 32515, - - /// - /// Hand. - /// - Hand = 32649, - - /// - /// Arrow and question mark. - /// - Help = 32651, - - /// - /// I-beam. - /// - IBeam = 32513, - - /// - /// Obsolete for applications marked version 4.0 or later. - /// - Icon = 32641, - - /// - /// Slashed circle. - /// - No = 32648, - - /// - /// Obsolete for applications marked version 4.0 or later. Use . - /// - Size = 32640, - - /// - /// Four-pointed arrow pointing north, south, east, and west. - /// - SizeAll = 32646, - - /// - /// Double-pointed arrow pointing northeast and southwest. - /// - SizeNortheastSouthwest = 32643, - - /// - /// Double-pointed arrow pointing north and south. - /// - SizeNorthSouth = 32645, - - /// - /// Double-pointed arrow pointing northwest and southeast. - /// - SizeNorthwestSoutheast = 32642, - - /// - /// Double-pointed arrow pointing west and east. - /// - SizeWestEast = 32644, - - /// - /// Vertical arrow. - /// - UpArrow = 32516, - - /// - /// Hourglass. - /// - Wait = 32514 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs b/Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs deleted file mode 100644 index 1389972c..00000000 --- a/Crow/src/backends/win32/User32/Enums/DeviceBroadcastType.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Used in the . - /// - public enum DeviceBroadcastType : uint - { - /// - /// This member is not officially documented. Use with care. - /// - Oem = 0, - - /// - /// This member is not officially documented. Use with care. - /// - DevNode = 1, - - /// - /// This member is not officially documented. Use with care. - /// - Volume = 2, - - /// - /// This member is not officially documented. Use with care. - /// - Port = 3, - - /// - /// This member is not officially documented. Use with care. - /// - Net = 4, - - /// - /// This member is not officially documented. Use with care. - /// - DeviceInterface = 5, - - /// - /// This member is not officially documented. Use with care. - /// - Handle = 6 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs b/Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs deleted file mode 100644 index ea642a9f..00000000 --- a/Crow/src/backends/win32/User32/Enums/DeviceModeFieldFlags.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used in the structure to specify whether certain members of the structure - /// have been initialized. - /// If a member is initialized, its corresponding bit is set, otherwise the bit is clear. - /// A driver supports only those members that are appropriate for the - /// printer or display technology. - /// - [Flags] - public enum DeviceModeFieldFlags : uint - { - /// - /// Specifies whether the field is set. - /// - Orientation = 0x00000001, - - /// - /// Specifies whether the field is set. - /// - PaperSize = 0x00000002, - - /// - /// Specifies whether the field is set. - /// - PaperLength = 0x00000004, - - /// - /// Specifies whether the field is set. - /// - PaperWidth = 0x00000008, - - /// - /// Specifies whether the field is set. - /// - Scale = 0x00000010, - - /// - /// Specifies whether the field is set. - /// - Position = 0x00000020, - - /// - /// Specifies whether the field is set. - /// - Nup = 0x00000040, - - /// - /// Specifies whether the field is set. - /// - DisplayOrientation = 0x00000080, - - /// - /// Specifies whether the field is set. - /// - Copies = 0x00000100, - - /// - /// Specifies whether the field is set. - /// - DefaultSource = 0x00000200, - - /// - /// Specifies whether the field is set. - /// - PrintQuality = 0x00000400, - - /// - /// Specifies whether the field is set. - /// - Color = 0x00000800, - - /// - /// Specifies whether the field is set. - /// - Duplex = 0x00001000, - - /// - /// Specifies whether the field is set. - /// - YResolution = 0x00002000, - - /// - /// Specifies whether the field is set. - /// - TrueTypeOption = 0x00004000, - - /// - /// Specifies whether the field is set. - /// - Collate = 0x00008000, - - /// - /// Specifies whether the field is set. - /// - FormName = 0x00010000, - - /// - /// Specifies whether the field is set. - /// - LogPixels = 0x00020000, - - /// - /// Specifies whether the field is set. - /// - BitsPerPixel = 0x00040000, - - /// - /// Specifies whether the field is set. - /// - WidthInPixels = 0x00080000, - - /// - /// Specifies whether the field is set. - /// - HeightInPixels = 0x00100000, - - /// - /// Specifies whether the field is set. - /// - DisplayFlags = 0x00200000, - - /// - /// Specifies whether the field is set. - /// - DisplayFrequency = 0x00400000, - - /// - /// Specifies whether the field is set. - /// - IcmMethod = 0x00800000, - - /// - /// Specifies whether the field is set. - /// - IcmIntent = 0x01000000, - - /// - /// Specifies whether the field is set. - /// - MediaType = 0x02000000, - - /// - /// Specifies whether the field is set. - /// - DitherType = 0x04000000, - - /// - /// Specifies whether the field is set. - /// - PanningWidth = 0x08000000, - - /// - /// Specifies whether the field is set. - /// - PanningHeight = 0x10000000, - - /// - /// Specifies whether the field is set. - /// - DisplayFixedOutput = 0x20000000, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DeviceNotification.cs b/Crow/src/backends/win32/User32/Enums/DeviceNotification.cs deleted file mode 100644 index f0a455ac..00000000 --- a/Crow/src/backends/win32/User32/Enums/DeviceNotification.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Used in - /// - /// to specify additional information. - /// - public enum DeviceNotificationEnum - { - /// - /// The recipient parameter is a window handle. - /// - WindowHandle = 0x00000000, - - /// - /// The recipient parameter is a service status handle. - /// - ServiceHandle = 0x00000001, - - /// - /// Notifies the recipient of device interface events for all device interface classes. - /// (The dbcc_classguid member is ignored.) - /// This value can be used only if the dbch_devicetype member is - /// . - /// - AllInterfaceClasses = 0x00000004 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs b/Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs deleted file mode 100644 index 54a44912..00000000 --- a/Crow/src/backends/win32/User32/Enums/DisplayDeviceStateFlags.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used in to represent the device state. - /// - [Flags] - public enum DisplayDeviceStateFlags : uint - { - /// - /// This member is not officially documented. Use with care. - /// - AttachedToDesktop = 0x00000001, - - /// - /// This member is not officially documented. Use with care. - /// - MultiDriver = 0x00000002, - - /// - /// The primary desktop is on the device. For a system with a single display card, this is always set. For a - /// system with multiple display cards, only one device can have this set. - /// - PrimaryDevice = 0x00000004, - - /// - /// Represents a pseudo device used to mirror application drawing for remoting or other purposes. - /// An invisible pseudo monitor is associated with this device. - /// - MirroringDriver = 0x00000008, - - /// - /// The device is VGA compatible. - /// - VgaCompatible = 0x00000010, - - /// - /// The device is removable; it cannot be the primary display. - /// - Removable = 0x00000020, - - /// - /// The device has more display modes than its output devices support. - /// - ModesPruned = 0x08000000, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs b/Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs deleted file mode 100644 index 71256c0a..00000000 --- a/Crow/src/backends/win32/User32/Enums/DisplayFixedOutputType.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// For fixed-resolution displays, specifies how the device can present a lower-resolution - /// mode on a higher-resolution display. - /// - public enum DisplayFixedOutputType : uint - { - /// - /// The display device presents a lower-resolution mode image by stretching it to fill the larger screen space. - /// - Stretch = 1, - - /// - /// The display device presents a lower resolution mode image by centering it in the larger screen space. - /// - Center = 2, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayFlags.cs b/Crow/src/backends/win32/User32/Enums/DisplayFlags.cs deleted file mode 100644 index 17ad23ff..00000000 --- a/Crow/src/backends/win32/User32/Enums/DisplayFlags.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the device's display mode. - /// - [Flags] - public enum DisplayFlags : uint - { - /// - /// Specifies that the display is a noncolor device. If this flag is not set, color is assumed. - /// - Grayscale = 0x00000001, - - /// - /// Specifies that the display mode is interlaced. If the flag is not set, noninterlaced is assumed. - /// - Interlaced = 0x00000002, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs b/Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs deleted file mode 100644 index 6c004218..00000000 --- a/Crow/src/backends/win32/User32/Enums/DisplayModeSetting.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Used in and - /// to specify which information should be retrieved. - /// - public enum DisplayModeSetting : uint - { - /// - /// Retrieve the current settings for the display device. - /// - CurrentSettings = unchecked((uint)(-1)), - - /// - /// Retrieve the settings for the display device that are currently stored in the registry. - /// - RegistrySettings = unchecked((uint)(-2)) - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs b/Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs deleted file mode 100644 index c7bd5a44..00000000 --- a/Crow/src/backends/win32/User32/Enums/DisplayOrientation.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Defines possible display orientations. - /// - public enum DisplayOrientation : uint - { - /// - /// The current mode's display device orientation is the natural orientation of the device, - /// and should be used as the default. - /// - Default = 0, - - /// - /// The display device orientation is 90 degrees (measured clockwise) from that of . - /// - Rotated90 = 1, - - /// - /// The display device orientation is 180 degrees (measured clockwise) from that of . - /// - Rotated180 = 2, - - /// - /// The display device orientation is 270 degrees (measured clockwise) from that of . - /// - Rotated270 = 3, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs b/Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs deleted file mode 100644 index e65084fd..00000000 --- a/Crow/src/backends/win32/User32/Enums/DisplaySettingsChanges.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used in - /// and to indicate how the graphics mode should be changed. - /// - [Flags] - public enum DisplaySettingsChanges : uint - { - /// - /// The graphics mode for the current screen will be changed dynamically. - /// - Dynamic = 0, - - /// - /// The graphics mode for the current screen will be changed dynamically and the graphics mode will be - /// updated in the registry. The mode information is stored in the USER profile. - /// - UpdateRegistry = 0x00000001, - - /// - /// The system tests if the requested graphics mode could be set. - /// - Test = 0x00000002, - - /// - /// The mode is temporary in nature. - /// If you change to and from another desktop, this mode will not be reset. - /// - Fullscreen = 0x00000004, - - /// - /// The settings will be saved in the global settings area so that they will affect all users on the machine. - /// Otherwise, only the settings for the user are modified. - /// This flag is only valid when specified with the flag. - /// - Global = 0x00000008, - - /// - /// This device will become the primary device. - /// - SetPrimary = 0x00000010, - - /// - /// Not supported by . - /// Only supported on Vista and higher. - /// - VideoParameters = 0x00000020, - - /// - /// Not supported by . - /// Only supported on Vista and higher. - /// - EnableUnsafeModes = 0x00000100, - - /// - /// Not supported by . - /// Only supported on Vista and higher. - /// - DisableUnsafeModes = 0x00000200, - - /// - /// The settings should be changed, even if the requested settings are the same as the current settings. - /// - Reset = 0x40000000, - - /// - /// The settings will be saved in the registry, but will not take effect. - /// This flag is only valid when specified with the flag. - /// - NoReset = 0x10000000 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs b/Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs deleted file mode 100644 index 08c1cb2e..00000000 --- a/Crow/src/backends/win32/User32/Enums/EnumDisplayModes.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Flags used in to specify which graphics modes to return. - /// - [Flags] - public enum EnumDisplayModes - { - /// - /// If set, the function will return all graphics modes reported by the adapter driver, regardless of - /// monitor capabilities. Otherwise, it will only return modes that are compatible with current monitors. - /// - RawMode = 0x00000002, - - /// - /// If set, the function will return graphics modes in all orientations. Otherwise, it will only return - /// modes that have the same orientation as the one currently set for the requested display. - /// - RotatedMode = 0x00000004, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs b/Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs deleted file mode 100644 index 538b674c..00000000 --- a/Crow/src/backends/win32/User32/Enums/ExtendedWindowStyles.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Defines extended window style flags for usage in and . - /// - [Flags] - public enum ExtendedWindowStyles : uint - { - /// - /// The window has a double border; the window can, optionally, be created with a title bar - /// by specifying the style in the dwStyle parameter. - /// - DialogModalFrame = 0x00000001, - - /// - /// The child window created with this style does not send the message - /// to its parent window when it is created or destroyed. - /// - NoParentModify = 0x00000004, - - /// - /// The window should be placed above all non-topmost windows and should stay above them, - /// even when the window is deactivated. To add or remove this style, use the - /// function. - /// - Topmost = 0x00000008, - - /// - /// The window accepts drag-drop files. - /// - AcceptFiles = 0x00000010, - - /// - /// The window should not be painted until siblings beneath the window - /// (that were created by the same thread) have been painted. - /// The window appears transparent because the bits of underlying - /// sibling windows have already been painted. - /// To achieve transparency without these restrictions, use the SetWindowRgn function. - /// - Transparent = 0x00000020, - - /// - /// The window is a MDI child window. - /// - MdiChild = 0x00000040, - - /// - /// The window is intended to be used as a floating toolbar. A tool window has a title bar - /// that is shorter than a normal title bar, and the window title is drawn using a smaller font. - /// A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. - /// If a tool window has a system menu, its icon is not displayed on the title bar. However, - /// you can display the system menu by right-clicking or by typing ALT+SPACE. - /// - ToolWindow = 0x00000080, - - /// - /// The window has a border with a raised edge. - /// - WindowEdge = 0x00000100, - - /// - /// The window has a border with a sunken edge. - /// - ClientEdge = 0x00000200, - - /// - /// The title bar of the window includes a question mark. When the user clicks the question mark, - /// the cursor changes to a question mark with a pointer. If the user then clicks a child window, - /// the child receives a message. The child window should pass the message to - /// the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. - /// The Help application displays a pop-up window that typically contains help for the child window. - /// cannot be used with the - /// or styles. - /// - ContextHelp = 0x00000400, - - /// - /// The window has generic "right-aligned" properties. This depends on the window class. - /// This style has an effect only if the shell language is Hebrew, Arabic, or another language - /// that supports reading-order alignment; otherwise, the style is ignored. - /// Using the style for static or edit controls has the same effect as using the SS_RIGHT - /// or ES_RIGHT style, respectively. Using this style with button controls has the same effect - /// as using BS_RIGHT and BS_RIGHTBUTTON styles. - /// - Right = 0x00001000, - - /// - /// The window has generic left-aligned properties. This is the default. - /// - Left = 0x00000000, - - /// - /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, - /// the window text is displayed using right-to-left reading-order properties. For other languages, - /// the style is ignored. - /// - RtlReading = 0x00002000, - - /// - /// The window text is displayed using left-to-right reading-order properties. This is the default. - /// - LtrReading = 0x00000000, - - /// - /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, - /// the vertical scroll bar (if present) is to the left of the client area. - /// For other languages, the style is ignored. - /// - LeftScrollbar = 0x00004000, - - /// - /// The vertical scroll bar (if present) is to the right of the client area. This is the default. - /// - RightScrollbar = 0x00000000, - - /// - /// The window itself contains child windows that should take part in dialog box navigation. - /// If this style is specified, the dialog manager recurses into children of this window when performing - /// navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic. - /// - ControlParent = 0x00010000, - - /// - /// The window has a three-dimensional border style intended to be used for items - /// that do not accept user input. - /// - StaticEdge = 0x00020000, - - /// - /// Forces a top-level window onto the taskbar when the window is visible. - /// - AppWindow = 0x00040000, - - /// - /// The window is an overlapped window. - /// - OverlappedWindow = WindowEdge | ClientEdge, - - /// - /// The window is palette window, which is a modeless dialog box that presents an array of commands. - /// - PaletteWindow = WindowEdge | ToolWindow | Topmost, - - /// - /// The window is a layered window. This style cannot be used if the window has - /// a class style of either or - /// . - /// - Layered = 0x00080000, - - /// - /// The window does not pass its window layout to its child windows. - /// - NoInheritLayout = 0x00100000, - - /// - /// The window does not render to a redirection surface. This is for windows that do not have visible - /// content or that use mechanisms other than surfaces to provide their visual. - /// - NoRedirectionBitmap = 0x00200000, - - /// - /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, - /// the horizontal origin of the window is on the right edge. - /// Increasing horizontal values advance to the left. - /// - LayoutRtl = 0x00400000, - - /// - /// Paints all descendants of a window in bottom-to-top painting order using double-buffering. - /// This cannot be used if the window has a class style of either - /// or . - /// - Composited = 0x02000000, - - /// - /// A top-level window created with this style does not become the foreground window when the user clicks it. - /// The system does not bring this window to the foreground when the user minimizes or closes - /// the foreground window. - /// The window should not be activated through programmatic access or via keyboard navigation by accessible - /// technology, such as Narrator. - /// To activate the window, use the SetActiveWindow or - /// function. - /// The window does not appear on the taskbar by default. To force the window to appear on the taskbar, - /// use the style. - /// - NoActivate = 0x08000000 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs b/Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs deleted file mode 100644 index a138f791..00000000 --- a/Crow/src/backends/win32/User32/Enums/GetMouseMovePointsResolution.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the resolution desired by . - /// - public enum GetMouseMovePointsResolution : uint - { - /// - /// Retrieves the points using the display resolution. - /// - UseDisplayPoints = 1, - - /// - /// Retrieves high resolution points. Points can range from zero to 65,535 (0xFFFF) in both x- and - /// y-coordinates. This is the resolution provided by absolute coordinate pointing devices - /// such as drawing tablets. - /// - UseHighResolutionPoints = 2 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs b/Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs deleted file mode 100644 index efc773ce..00000000 --- a/Crow/src/backends/win32/User32/Enums/GetRawInputDataCommand.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies which type of raw input data to get in a function call. - /// - public enum GetRawInputDataCommand : uint - { - /// - /// Get the raw data from the structure. - /// - Input = 0x10000003, - - /// - /// Get the header information from the structure. - /// - Header = 0x10000005 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs b/Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs deleted file mode 100644 index 01f82ffb..00000000 --- a/Crow/src/backends/win32/User32/Enums/GetRawInputDeviceInfoEnum.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Used in to specify what data to return in the data parameter. - /// - public enum GetRawInputDeviceInfoEnum : uint - { - /// - /// data points to the previously parsed data. - /// - PreparsedData = 0x20000005, - - /// - /// data points to a string that contains the device name. - /// For this command only, the value in dataSize is the character count (not the byte count). - /// - DeviceName = 0x20000007, - - /// - /// data points to an structure. - /// - DeviceInfo = 0x2000000b - } -} diff --git a/Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs b/Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs deleted file mode 100644 index 279608c5..00000000 --- a/Crow/src/backends/win32/User32/Enums/GetWindowLongIndex.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Pre-defines memory offsets in extra window memory for specific pieces information to be used in - /// and - /// . - /// - public enum GetWindowLongIndex - { - /// - /// Retrieves the address of the window procedure, or a handle - /// representing the address of the window procedure. - /// You must use the CallWindowProc function to call the window procedure. - /// - WindowProcedure = -4, - - /// - /// Retrieves a handle to the application instance. - /// - HInstance = -6, - - /// - /// Retrieves a handle to the parent window, if any. - /// Not supported in . - /// - HWndParent = -8, - - /// - /// Retrieves the identifier of the window. - /// - ID = -12, - - /// - /// Retrieves the window styles. - /// - Style = -16, - - /// - /// Retrieves the extended window styles. - /// - ExStyle = -20, - - /// - /// Retrieves the user data associated with the window. - /// This data is intended for use by the application that created the window. - /// Its value is initially zero. - /// - UserData = -21 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/IconName.cs b/Crow/src/backends/win32/User32/Enums/IconName.cs deleted file mode 100644 index d410b307..00000000 --- a/Crow/src/backends/win32/User32/Enums/IconName.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies resource identifiers for the pre-defined icons. - /// - public enum IconName - { - /// - /// Application icon. - /// - Application = 32512, - - /// - /// Stop sign icon. - /// - Hand = 32513, - - /// - /// Question-mark icon. - /// - Question = 32514, - - /// - /// Exclamation point icon. - /// - Exclamation = 32515, - - /// - /// Asterisk icon. - /// - Asterisk = 32516, - - /// - /// Application icon. - /// - WinLogo = 32517, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs b/Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs deleted file mode 100644 index 70de9c04..00000000 --- a/Crow/src/backends/win32/User32/Enums/MapVirtualKeyType.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Used in to specify the translation to be performed. - /// - public enum MapVirtualKeyType : uint - { - /// - /// uCode is a virtual-key code and is translated into a scan code. If it is a virtual-key code that does not - /// distinguish between left- and right-hand keys, the left-hand scan code is returned. - /// If there is no translation, the function returns 0. - /// - VirtualKeyToScanCode = 0, - - /// - /// uCode is a scan code and is translated into a virtual-key code that does not distinguish between left- and - /// right-hand keys. If there is no translation, the function returns 0. - /// - ScanCodeToVirtualKey = 1, - - /// - /// uCode is a virtual-key code and is translated into an unshifted character value in the low-order word of - /// the return value. Dead keys (diacritics) are indicated by setting the top bit of the return value. - /// If there is no translation, the function returns 0. - /// - VirtualKeyToCharacter = 2, - - /// - /// Windows NT/2000/XP: uCode is a scan code and is translated into a virtual-key code that distinguishes - /// between left- and right-hand keys. If there is no translation, the function returns 0. - /// - ScanCodeToVirtualKeyExtended = 3, - - /// - /// This member is not officially documented. Use with care. - /// - VirtualKeyToScanCodeExtended = 4 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs b/Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs deleted file mode 100644 index 50eb7e2d..00000000 --- a/Crow/src/backends/win32/User32/Enums/MonitorFromDefaultValue.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies what values to return if - /// and - /// - /// fail to find a monitor for the given arguments. - /// - public enum MonitorFromDefaultValue : uint - { - /// - /// Returns null. - /// - DefaultToNull = 0, - - /// - /// Returns a handle to the primary display monitor. - /// - DefaultToPrimary = 1, - - /// - /// Returns a handle to the display monitor that is nearest to the window/display monitor. - /// - DefaultToNearest = 2 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs b/Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs deleted file mode 100644 index 160bc91b..00000000 --- a/Crow/src/backends/win32/User32/Enums/PeekMessageActions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used in - /// to define what actions to take for retrieved messages. - /// - [Flags] - public enum PeekMessageActions : uint - { - /// - /// Messages are not removed from the queue after processing by . - /// - NoRemove = 0, - - /// - /// Messages are removed from the queue after processing by . - /// - Remove = 1, - - /// - /// Prevents the system from releasing any thread that is waiting for the caller to go idle - /// (see WaitForInputIdle). Combine this value with either or . - /// - NoYield = 2, - - /// - /// Process mouse and keyboard messages. - /// - QSInput = QueueMessageTypes.Input << 16, - - /// - /// Process paint messages. - /// - QSPaint = QueueMessageTypes.Paint << 16, - - /// - /// Process all posted messages, including timers and hotkeys. - /// - QSPostMessage = (QueueMessageTypes.PostMessage | QueueMessageTypes.Hotkey | QueueMessageTypes.Timer) << 16, - - /// - /// Process all sent messages. - /// - QSSendMessage = QueueMessageTypes.SendMessage << 16 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterColor.cs b/Crow/src/backends/win32/User32/Enums/PrinterColor.cs deleted file mode 100644 index 2e3606e2..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterColor.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the color mode to use with color printers. - /// - public enum PrinterColor : short - { - /// - /// Use monochrome printing mode. - /// - Monochrome = 1, - - /// - /// Use color printing mode. - /// - Color = 2, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs b/Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs deleted file mode 100644 index d2bb026d..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterDefaultSource.cs +++ /dev/null @@ -1,84 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// For a printer, specifies the paper source. - /// - public enum PrinterDefaultSource : short - { - /// - /// Select the upper paper bin. - /// This value is also used for the paper source for printers that only have one paper bin. - /// - Upper = 1, - - /// - /// Same as . - /// - OnlyOne = 1, - - /// - /// Select the lower bin. - /// - Lower = 2, - - /// - /// Select the middle paper bin. - /// - Middle = 3, - - /// - /// Manually select the paper bin. - /// - Manual = 4, - - /// - /// Select the auto envelope bin. - /// - Envelope = 5, - - /// - /// Select the manual envelope bin. - /// - EnvelopeManual = 6, - - /// - /// Auto-select the bin. - /// - Auto = 7, - - /// - /// Select the bin with the tractor paper. - /// - Tractor = 8, - - /// - /// Select the bin with the smaller paper format. - /// - SmallFormat = 9, - - /// - /// Select the bin with the larger paper format. - /// - LargeFormat = 10, - - /// - /// Select the bin with large capacity. - /// - LargeCapacity = 11, - - /// - /// Select the cassette bin. - /// - Cassette = 14, - - /// - /// Select the bin with the required form. - /// - FormSource = 15, - - /// - /// Starting value for user-defined printer sources. - /// - User = 256, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs b/Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs deleted file mode 100644 index 7b8a8868..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterDitherType.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// For printers, specifies types of dithering. - /// - public enum PrinterDitherType : uint - { - /// - /// No dithering. - /// - None = 1, - - /// - /// Dithering with a coarse brush. - /// - Coarse = 2, - - /// - /// Dithering with a fine brush. - /// - Fine = 3, - - /// - /// Line art dithering, a special dithering method that produces well defined borders between black, white, - /// and gray scaling. It is not suitable for images that include continuous graduations in intensity and hue, - /// such as scanned photographs. - /// - LineArt = 4, - - /// - /// Error diffusion dithering. - /// Only supported on Windows 95, 98, and Millennium Edition. - /// - ErrorDiffusion = 5, - - /// - /// Reserved. Do not use. - /// - Reserved6 = 6, - - /// - /// Reserved. Do not use. - /// - Reserved7 = 7, - - /// - /// Reserved. Do not use. - /// - Reserved8 = 8, - - /// - /// Reserved. Do not use. - /// - Reserved9 = 9, - - /// - /// Device does gray scaling. - /// - Grayscale = 10, - - /// - /// This is the starting value for user-defined values. - /// - User = 256, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs b/Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs deleted file mode 100644 index 1caa897b..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterDuplex.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies duplex (double-sided) printing for duplex-capable printers. - /// - public enum PrinterDuplex : short - { - /// - /// Print single-sided. - /// - SimpleX = 1, - - /// - /// Print double-sided, using long edge binding. - /// - Vertical = 2, - - /// - /// Print double-sided, using short edge binding. - /// - Horizontal = 3, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs b/Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs deleted file mode 100644 index 9ae6e24d..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterIcmIntent.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies which color matching method, or intent, is used by default. - /// - public enum PrinterIcmIntent : uint - { - /// - /// Optimize for color saturation. - /// This value is the most appropriate choice for business graphs when dithering is not desired. - /// - Saturate = 1, - - /// - /// Optimize for color contrast. - /// This value is the most appropriate choice for scanned or photographic images when dithering is desired. - /// - Contrast = 2, - - /// - /// Optimize to match the exact color requested. - /// This value is most appropriate for use with business logos - /// or other images when an exact color match is desired. - /// - Colorimetric = 3, - - /// - /// Optimize to match the exact color requested without white point mapping. - /// This value is most appropriate for use with proofing. - /// - AbsoluteColorimetric = 4, - - /// - /// This is the starting value for user-defined values. - /// - User = 256, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs b/Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs deleted file mode 100644 index 0a98c6cf..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterIcmMethod.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies how Image Color Management (ICM) is handled. - /// - public enum PrinterIcmMethod : uint - { - /// - /// Specifies that ICM is disabled. - /// - None = 1, - - /// - /// Specifies that ICM is handled by the system on which the page description language (PDL) data is generated. - /// - System = 2, - - /// - /// Specifies that ICM is handled by the printer driver. - /// - Driver = 3, - - /// - /// Specifies that ICM is handled by the destination device. - /// - Device = 4, - - /// - /// This is the starting value for user-defined values. - /// - User = 256, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs b/Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs deleted file mode 100644 index 3db4d065..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterMediaType.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the type of media being printed on. - /// - public enum PrinterMediaType : uint - { - /// - /// Plain paper. - /// - Standard = 1, - - /// - /// Transparent film. - /// - Transparency = 2, - - /// - /// Glossy paper. - /// - Glossy = 3, - - /// - /// This is the starting value for user-defined values. - /// - User = 256, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs b/Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs deleted file mode 100644 index 2e0372d1..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterNupHandling.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the responsibility for performing page layout for N-up printing. - /// - public enum PrinterNupHandling : uint - { - /// - /// The print server does the page layout. - /// - System = 1, - - /// - /// The application does the page layout. - /// - OneUp = 2, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs b/Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs deleted file mode 100644 index 0543a354..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterPaperOrientation.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// For printers, the orientation for output. - /// - public enum PrinterPaperOrientation : short - { - /// - /// "Portrait" orientation. - /// - Portrait = 1, - - /// - /// "Landscape" orientation. - /// - Landscape = 2, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs b/Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs deleted file mode 100644 index e0ac4a9d..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterPaperSize.cs +++ /dev/null @@ -1,600 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Lists all defined types for paper size, with , , and - /// being the most typical. All types not included in this enum are reserved. - /// Note that the paper size types cannot be combined with one another. - /// - public enum PrinterPaperSize : short - { - /// - /// US Letter 8 1/2 x 11 in - /// - Letter = 1, - - /// - /// US Letter Small 8 1/2 x 11 in - /// - LetterSmall = 2, - - /// - /// US Tabloid 11 x 17 in - /// - Tabloid = 3, - - /// - /// US Ledger 17 x 11 in - /// - Ledger = 4, - - /// - /// US Legal 8 1/2 x 14 in - /// - Legal = 5, - - /// - /// US Statement 5 1/2 x 8 1/2 in - /// - Statement = 6, - - /// - /// US Executive 7 1/4 x 10 1/2 in - /// - Executive = 7, - - /// - /// A3 297 x 420 mm - /// - A3 = 8, - - /// - /// A4 210 x 297 mm - /// - A4 = 9, - - /// - /// A4 Small 210 x 297 mm - /// - A4Small = 10, - - /// - /// A5 148 x 210 mm - /// - A5 = 11, - - /// - /// B4 (JIS) 257 x 364 mm - /// - B4 = 12, - - /// - /// B5 (JIS) 182 x 257 mm - /// - B5 = 13, - - /// - /// Folio 8 1/2 x 13 in - /// - Folio = 14, - - /// - /// Quarto 215 x 275 mm - /// - Quarto = 15, - - /// - /// 10 x 14 in - /// - TenByFourteenInches = 16, - - /// - /// 11 x 17 in - /// - ElevenBySeventeenInches = 17, - - /// - /// US Note 8 1/2 x 11 in - /// - Note = 18, - - /// - /// US Envelope #9 3 7/8 x 8 7/8 - /// - Envelope9 = 19, - - /// - /// US Envelope #10 4 1/8 x 9 1/2 - /// - Envelope10 = 20, - - /// - /// US Envelope #11 4 1/2 x 10 3/8 - /// - Envelope11 = 21, - - /// - /// US Envelope #12 4 3/4 x 11 in - /// - Envelope12 = 22, - - /// - /// US Envelope #14 5 x 11 1/2 - /// - Envelope14 = 23, - - /// - /// C size sheet - /// - CSheet = 24, - - /// - /// D size sheet - /// - DSheet = 25, - - /// - /// E size sheet - /// - ESheet = 26, - - /// - /// Envelope DL 110 x 220mm - /// - EnvelopeDL = 27, - - /// - /// Envelope C5 162 x 229 mm - /// - EnvelopeC5 = 28, - - /// - /// Envelope C3 324 x 458 mm - /// - EnvelopeC3 = 29, - - /// - /// Envelope C4 229 x 324 mm - /// - EnvelopeC4 = 30, - - /// - /// Envelope C6 114 x 162 mm - /// - EnvelopeC6 = 31, - - /// - /// Envelope C65 114 x 229 mm - /// - EnvelopeC65 = 32, - - /// - /// Envelope B4 250 x 353 mm - /// - EnvelopeB4 = 33, - - /// - /// Envelope B5 176 x 250 mm - /// - EnvelopeB5 = 34, - - /// - /// Envelope B6 176 x 125 mm - /// - EnvelopeB6 = 35, - - /// - /// Envelope 110 x 230 mm - /// - EnvelopeItaly = 36, - - /// - /// US Envelope Monarch 3.875 x 7.5 in - /// - EnvelopeMonarch = 37, - - /// - /// 6 3/4 US Envelope 3 5/8 x 6 1/2 in - /// - EnvelopePersonal = 38, - - /// - /// US Std Fanfold 14 7/8 x 11 in - /// - FanfoldUS = 39, - - /// - /// German Std Fanfold 8 1/2 x 12 in - /// - FanfoldStandardGerman = 40, - - /// - /// German Legal Fanfold 8 1/2 x 13 in - /// - FanfoldLegalGerman = 41, - - /// - /// B4 (ISO) 250 x 353 mm - /// - IsoB4 = 42, - - /// - /// Japanese Postcard 100 x 148 mm - /// - JapanesePostcard = 43, - - /// - /// 9 x 11 in - /// - NineByElevenInches = 44, - - /// - /// 10 x 11 in - /// - TenByElevenInches = 45, - - /// - /// 15 x 11 in - /// - FifteenByElevenInches = 46, - - /// - /// Envelope Invite 220 x 220 mm - /// - EnvelopeInvite = 47, - - /// - /// RESERVED--DO NOT USE - /// - Reserved48 = 48, - - /// - /// RESERVED--DO NOT USE - /// - Reserved49 = 49, - - /// - /// US Letter Extra 9 1/2 x 12 in - /// - LetterExtra = 50, - - /// - /// US Legal Extra 9 1/2 x 15 in - /// - LegalExtra = 51, - - /// - /// US Tabloid Extra 11.69 x 18 in - /// - TabloidExtra = 52, - - /// - /// A4 Extra 9.27 x 12.69 in - /// - A4Extra = 53, - - /// - /// Letter Transverse 8 1/2 x 11 in - /// - LetterTransverse = 54, - - /// - /// A4 Transverse 210 x 297 mm - /// - A4Transverse = 55, - - /// - /// Letter Extra Transverse 9 1/2 x 12 in - /// - LetterExtraTransverse = 56, - - /// - /// SuperA/SuperA/A4 227 x 356 mm - /// - APlus = 57, - - /// - /// SuperB/SuperB/A3 305 x 487 mm - /// - BPlus = 58, - - /// - /// US Letter Plus 8.5 x 12.69 in - /// - LetterPlus = 59, - - /// - /// A4 Plus 210 x 330 mm - /// - A4Plus = 60, - - /// - /// A5 Transverse 148 x 210 mm - /// - A5Transverse = 61, - - /// - /// B5 (JIS) Transverse 182 x 257 mm - /// - B5Transverse = 62, - - /// - /// A3 Extra 322 x 445 mm - /// - A3Extra = 63, - - /// - /// A5 Extra 174 x 235 mm - /// - A5Extra = 64, - - /// - /// B5 (ISO) Extra 201 x 276 mm - /// - B5Extra = 65, - - /// - /// A2 420 x 594 mm - /// - A2 = 66, - - /// - /// A3 Transverse 297 x 420 mm - /// - A3Transverse = 67, - - /// - /// A3 Extra Transverse 322 x 445 mm - /// - A3ExtraTransverse = 68, - - /// - /// Japanese Double Postcard 200 x 148 mm - /// - DoubleJapanesePostcard = 69, - - /// - /// A6 105 x 148 mm - /// - A6 = 70, - - /// - /// Japanese Envelope Kaku #2 - /// - JapaneseEnvelopeKaku2 = 71, - - /// - /// Japanese Envelope Kaku #3 - /// - JapaneseEnvelopeKaku3 = 72, - - /// - /// Japanese Envelope Chou #3 - /// - JapaneseEnvelopeChou3 = 73, - - /// - /// Japanese Envelope Chou #4 - /// - JapaneseEnvelopeChou4 = 74, - - /// - /// Letter Rotated 11 x 8 1/2 11 in - /// - LetterRotated = 75, - - /// - /// A3 Rotated 420 x 297 mm - /// - A3Rotated = 76, - - /// - /// A4 Rotated 297 x 210 mm - /// - A4Rotated = 77, - - /// - /// A5 Rotated 210 x 148 mm - /// - A5Rotated = 78, - - /// - /// B4 (JIS) Rotated 364 x 257 mm - /// - B4JisRotated = 79, - - /// - /// B5 (JIS) Rotated 257 x 182 mm - /// - B5JisRotated = 80, - - /// - /// Japanese Postcard Rotated 148 x 100 mm - /// - JapanesePostcardRotated = 81, - - /// - /// Double Japanese Postcard Rotated 148 x 200 mm - /// - DoubleJapanesePostcardRotated = 82, - - /// - /// A6 Rotated 148 x 105 mm - /// - A6Rotated = 83, - - /// - /// Japanese Envelope Kaku #2 Rotated - /// - JapaneseEnvelopeKaku2Rotated = 84, - - /// - /// Japanese Envelope Kaku #3 Rotated - /// - JapaneseEnvelopeKaku3Rotated = 85, - - /// - /// Japanese Envelope Chou #3 Rotated - /// - JapaneseEnvelopeChou3Rotated = 86, - - /// - /// Japanese Envelope Chou #4 Rotated - /// - JapaneseEnvelopeChou4Rotated = 87, - - /// - /// B6 (JIS) 128 x 182 mm - /// - B6Jis = 88, - - /// - /// B6 (JIS) Rotated 182 x 128 mm - /// - B6JisRotated = 89, - - /// - /// 12 x 11 in - /// - TwelveByElevenInches = 90, - - /// - /// Japanese Envelope You #4 - /// - JapaneseEnvelopeYou4 = 91, - - /// - /// Japanese Envelope You #4 Rotated - /// - JapaneseEnvelopeYou4Rotated = 92, - - /// - /// PRC 16K 146 x 215 mm - /// - Prc16K = 93, - - /// - /// PRC 32K 97 x 151 mm - /// - Prc32K = 94, - - /// - /// PRC 32K(Big) 97 x 151 mm - /// - Prc32KBig = 95, - - /// - /// PRC Envelope #1 102 x 165 mm - /// - PrcEnvelope1 = 96, - - /// - /// PRC Envelope #2 102 x 176 mm - /// - PrcEnvelope2 = 97, - - /// - /// PRC Envelope #3 125 x 176 mm - /// - PrcEnvelope3 = 98, - - /// - /// PRC Envelope #4 110 x 208 mm - /// - PrcEnvelope4 = 99, - - /// - /// PRC Envelope #5 110 x 220 mm - /// - PrcEnvelope5 = 100, - - /// - /// PRC Envelope #6 120 x 230 mm - /// - PrcEnvelope6 = 101, - - /// - /// PRC Envelope #7 160 x 230 mm - /// - PrcEnvelope7 = 102, - - /// - /// PRC Envelope #8 120 x 309 mm - /// - PrcEnvelope8 = 103, - - /// - /// PRC Envelope #9 229 x 324 mm - /// - PrcEnvelope9 = 104, - - /// - /// PRC Envelope #10 324 x 458 mm - /// - PrcEnvelope10 = 105, - - /// - /// PRC 16K Rotated - /// - P16KRotated = 106, - - /// - /// PRC 32K Rotated - /// - P32KRotated = 107, - - /// - /// PRC 32K(Big) Rotated - /// - P32KBigRotated = 108, - - /// - /// PRC Envelope #1 Rotated 165 x 102 mm - /// - PrcEnvelope1Rotated = 109, - - /// - /// PRC Envelope #2 Rotated 176 x 102 mm - /// - PrcEnvelope2Rotated = 110, - - /// - /// PRC Envelope #3 Rotated 176 x 125 mm - /// - PrcEnvelope3Rotated = 111, - - /// - /// PRC Envelope #4 Rotated 208 x 110 mm - /// - PrcEnvelope4Rotated = 112, - - /// - /// PRC Envelope #5 Rotated 220 x 110 mm - /// - PrcEnvelope5Rotated = 113, - - /// - /// PRC Envelope #6 Rotated 230 x 120 mm - /// - PrcEnvelope6Rotated = 114, - - /// - /// PRC Envelope #7 Rotated 230 x 160 mm - /// - PrcEnvelope7Rotated = 115, - - /// - /// PRC Envelope #8 Rotated 309 x 120 mm - /// - PrcEnvelope8Rotated = 116, - - /// - /// PRC Envelope #9 Rotated 324 x 229 mm - /// - PrcEnvelope9Rotated = 117, - - /// - /// PRC Envelope #10 Rotated 458 x 324 mm - /// - PrcEnvelope10Rotated = 118, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs b/Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs deleted file mode 100644 index e3392a63..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterPrintQuality.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// For printers, specifies the printer resolution. - /// Either specify one of these pre-defined values or specify a positive device-dependent resolution in DPI. - /// - public enum PrinterPrintQuality : short - { - /// - /// Draft-resolution printouts. - /// - Draft = -1, - - /// - /// Low-resolution printouts. - /// - Low = -2, - - /// - /// Medium-resolution printouts. - /// - Medium = -3, - - /// - /// High-resolution printouts. - /// - High = -4, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs b/Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs deleted file mode 100644 index 650542e2..00000000 --- a/Crow/src/backends/win32/User32/Enums/PrinterTrueTypeOption.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies how TrueType fonts should be printed. - /// - public enum PrinterTrueTypeOption : short - { - /// - /// Device will print TrueType fonts as graphics. - /// - Bitmap = 1, - - /// - /// Device will download TrueType fonts. - /// - Download = 2, - - /// - /// Device will substitute device fonts for TrueType fonts. - /// - SubstituteDevice = 3, - - /// - /// Downloads TrueType fonts as outline soft fonts. - /// - DownloadOutline = 4, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs b/Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs deleted file mode 100644 index cf9a09ea..00000000 --- a/Crow/src/backends/win32/User32/Enums/QueueMessageTypes.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Flags used in - /// to specify the types of messages to check for. - /// - [Flags] - public enum QueueMessageTypes : uint - { - /// - /// A , , - /// , or message - /// is in the queue. - /// - Key = 0x0001, - - /// - /// A message is in the queue. - /// - MouseMove = 0x0002, - - /// - /// A mouse-button message (, - /// , and so on). - /// - MouseButton = 0x0004, - - /// - /// A posted message (other than those listed here) is in the queue. - /// - PostMessage = 0x0008, - - /// - /// A message is in the queue. - /// - Timer = 0x0010, - - /// - /// A message is in the queue. - /// - Paint = 0x0020, - - /// - /// A message sent by another thread or application is in the queue. - /// - SendMessage = 0x0040, - - /// - /// A message is in the queue. - /// - Hotkey = 0x0080, - - /// - /// A posted message (other than those listed here) is in the queue. - /// - AllPostMessage = 0x0100, - - /// - /// A raw input message is in the queue. For more information, see Raw Input. - /// Windows XP and higher only. - /// - RawInput = 0x0400, - - /// - /// A message or mouse-button message - /// (, , and so on). - /// - Mouse = MouseMove | MouseButton, - - /// - /// An input message is in the queue. This is composed of , - /// and . - /// Windows XP and higher only. - /// - Input = Mouse | Key | RawInput, - - /// - /// An input message is in the queue. This is composed of and . - /// Windows 2000 and earlier. - /// - InputLegacy = Mouse | Key, - - /// - /// An input, , , - /// , or posted message is in the queue. - /// - AllEvents = Input | PostMessage | Timer | Paint | Hotkey, - - /// - /// Any message is in the queue. - /// - AllInput = Input | PostMessage | Timer | Paint | Hotkey | SendMessage - } -} diff --git a/Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs b/Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs deleted file mode 100644 index 3d4230eb..00000000 --- a/Crow/src/backends/win32/User32/Enums/RawInputDeviceFlags.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used in to specify how to interpret the data in the structure. - /// - [Flags] - public enum RawInputDeviceFlags : uint - { - /// - /// If set, this removes the top level collection from the inclusion list. - /// This tells the operating system to stop reading from a device which matches the top level collection. - /// - Remove = 0x00000001, - - /// - /// If set, this specifies the top level collections to exclude when reading a complete usage page. - /// This flag only affects a TLC whose usage page is already specified with RawInputDeviceEnum.PAGEONLY. - /// - Exclude = 0x00000010, - - /// - /// If set, this specifies all devices whose top level collection is from the specified UsagePage. - /// Note that usUsage must be zero. To exclude a particular top level collection, use EXCLUDE. - /// - PageOnly = 0x00000020, - - /// - /// If set, this prevents any devices specified by UsagePage or Usage from generating legacy messages. - /// This is only for the mouse and keyboard. See RawInputDevice Remarks. - /// - NoLegacy = 0x00000030, - - /// - /// If set, this enables the caller to receive the input even when the caller is not in the foreground. - /// Note that Target must be specified in RawInputDevice. - /// - InputSink = 0x00000100, - - /// - /// If set, the mouse button click does not activate the other window. - /// - CaptureMouse = 0x00000200, // effective when mouse nolegacy is specified, otherwise it would be an error - - /// - /// If set, the application-defined keyboard device hotkeys are not handled. - /// However, the system hotkeys; for example, ALT+TAB and CTRL+ALT+DEL, are still handled. - /// By default, all keyboard hotkeys are handled. - /// NOHOTKEYS can be specified even if NOLEGACY is not specified and Target is NULL in RawInputDevice. - /// - NoHotkeys = 0x00000200, // effective for keyboard. - - /// - /// Microsoft Windows XP Service Pack 1 (SP1): If set, the application command keys are handled. APPKEYS can be - /// specified only if NOLEGACY is specified for a keyboard device. - /// - AppKeys = 0x00000400, // effective for keyboard. - - /// - /// If set, this enables the caller to receive input in the background only if the foreground application - /// does not process it. In other words, if the foreground application is not registered for raw input, - /// then the background application that is registered will receive the input. - /// Only supported on Vista later. - /// - ExInputSink = 0x00001000, - - /// - /// If set, this enables the caller to receive WM_INPUT_DEVICE_CHANGE notifications for device arrival and - /// device removal. - /// Only supported on Vista and later. - /// - DevNotify = 0x00002000 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs b/Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs deleted file mode 100644 index 95fa0679..00000000 --- a/Crow/src/backends/win32/User32/Enums/RawInputDeviceType.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the type of raw input device. - /// - public enum RawInputDeviceType : uint - { - /// - /// Data comes from a mouse. - /// - Mouse = 0, - - /// - /// Data comes from a keyboard. - /// - Keyboard = 1, - - /// - /// Data comes from an HID that is not a keyboard or a mouse. - /// - Hid = 2 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs b/Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs deleted file mode 100644 index e4725d54..00000000 --- a/Crow/src/backends/win32/User32/Enums/RawKeyboardScanCodeFlags.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Flags for scan code information. - /// - public enum RawKeyboardScanCodeFlags : ushort - { - /// - /// The key is down. - /// - Make = 0x0, - - /// - /// The key is up. - /// - Break = 0x1, - - /// - /// The scan code has the E0 prefix. - /// - E0 = 0x2, - - /// - /// The scan code has the E1 prefix. - /// - E1 = 0x4, - - /// - /// This member is not officially documented. Use with care. - /// - TermsrvSetLed = 0x8, - - /// - /// This member is not officially documented. Use with care. - /// - TermsrvShadow = 0x10 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs b/Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs deleted file mode 100644 index 174f6598..00000000 --- a/Crow/src/backends/win32/User32/Enums/RawMouseButtonFlags.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the transition state of the mouse buttons. - /// - [Flags] - public enum RawMouseButtonFlags : ushort - { - /// - /// Left Button changed to down. - /// - LeftButtonDown = 0x0001, - - /// - /// Left Button changed to up. - /// - LeftButtonUp = 0x0002, - - /// - /// Right Button changed to down. - /// - RightButtonDown = 0x0004, - - /// - /// Right Button changed to up. - /// - RightButtonUp = 0x0008, - - /// - /// Middle Button changed to down. - /// - MiddleButtonDown = 0x0010, - - /// - /// Middle Button changed to up. - /// - MiddleButtonUp = 0x0020, - - /// - /// Same as . - /// - Button1Down = LeftButtonDown, - - /// - /// Same as . - /// - Button1Up = LeftButtonUp, - - /// - /// Same as . - /// - Button2Down = RightButtonDown, - - /// - /// Same as . - /// - Button2Up = RightButtonUp, - - /// - /// Same as . - /// - Button3Down = MiddleButtonDown, - - /// - /// Same as . - /// - Button3Up = MiddleButtonUp, - - /// - /// XBUTTON1 changed to down. - /// - Button4Down = 0x0040, - - /// - /// XBUTTON1 changed to up. - /// - Button4Up = 0x0080, - - /// - /// XBUTTON2 changed to down. - /// - Button5Down = 0x0100, - - /// - /// XBUTTON2 changed to up. - /// - Button5Up = 0x0200, - - /// - /// Raw input comes from a mouse wheel. The wheel delta is stored in . - /// - Wheel = 0x0400, - - /// - /// This member is not officially documented. Use with care. - /// - HWheel = 0x0800 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs b/Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs deleted file mode 100644 index c299c9e9..00000000 --- a/Crow/src/backends/win32/User32/Enums/RawMouseFlags.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Mouse indicator flags (found in winuser.h). - /// - [Flags] - public enum RawMouseFlags : ushort - { - /// - /// LastX/Y indicate relative motion. - /// - MouseMoveRelative = 0x00, - - /// - /// LastX/Y indicate absolute motion. - /// - MouseMoveAbsolute = 0x01, - - /// - /// The coordinates are mapped to the virtual desktop. - /// - MouseVirtualDesktop = 0x02, - - /// - /// Requery for mouse attributes. - /// - MouseAttributesChanged = 0x04 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs b/Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs deleted file mode 100644 index 6a80fb03..00000000 --- a/Crow/src/backends/win32/User32/Enums/SetWindowPosFlags.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Window sizing and positioning flags. - /// - [Flags] - public enum SetWindowPosFlags : uint - { - /// - /// Retains the current size (ignores the cx and cy parameters). - /// - NoSize = 0x0001, - - /// - /// Retains the current position (ignores the x and y parameters). - /// - NoMove = 0x0002, - - /// - /// Retains the current Z order (ignores the hwndInsertAfter parameter). - /// - NoZOrder = 0x0004, - - /// - /// Does not redraw changes. If this flag is set, no repainting of any kind occurs. - /// This applies to the client area, the nonclient area (including the title bar and scroll bars), - /// and any part of the parent window uncovered as a result of the window being moved. - /// When this flag is set, the application must explicitly invalidate or redraw any parts - /// of the window and parent window that need redrawing. - /// - NoRedraw = 0x0008, - - /// - /// Does not activate the window. If this flag is not set, - /// the window is activated and moved to the top of either the topmost or non-topmost group - /// (depending on the setting of the hwndInsertAfter member). - /// - NoActivate = 0x0010, - - /// - /// Sends a message to the window, even if the window's size is not - /// being changed. If this flag is not specified, is sent only when - /// the window's size is being changed. - /// - FrameChanged = 0x0020, - - /// - /// Displays the window. - /// - ShowWindow = 0x0040, - - /// - /// Hides the window. - /// - HideWindow = 0x0080, - - /// - /// Discards the entire contents of the client area. If this flag is not specified, - /// the valid contents of the client area are saved and copied back into the client area - /// after the window is sized or repositioned. - /// - NoCopyBits = 0x0100, - - /// - /// Does not change the owner window's position in the Z order. - /// - NoOwnerZOrder = 0x0200, - - /// - /// Prevents the window from receiving the message. - /// - NoSendChanging = 0x0400, - - /// - /// Draws a frame (defined in the window's class description) around the window. - /// - DrawFrame = FrameChanged, - - /// - /// Same as the flag. - /// - NoReposition = NoOwnerZOrder, - - /// - /// Prevents generation of the message. - /// - DeferErase = 0x2000, - - /// - /// If the calling thread and the thread that owns the window are attached to different input queues, - /// the system posts the request to the thread that owns the window. This prevents the calling thread - /// from blocking its execution while other threads process the request. - /// - AsyncWindowPos = 0x4000 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs b/Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs deleted file mode 100644 index 9df83949..00000000 --- a/Crow/src/backends/win32/User32/Enums/SetWindowPosHwndEnum.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies a set of pre-defined values for special behavior in . - /// - public enum SetWindowPosHwndEnum - { - /// - /// Places the window above all non-topmost windows (that is, behind all topmost windows). - /// This flag has no effect if the window is already a non-topmost window. - /// - NoTopmost = -2, - - /// - /// Places the window above all non-topmost windows. - /// The window maintains its topmost position even when it is deactivated. - /// - Topmost = -1, - - /// - /// Places the window at the top of the Z order. - /// - Top = 0, - - /// - /// Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, - /// the window loses its topmost status and is placed at the bottom of all other windows. - /// - Bottom = 1, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs b/Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs deleted file mode 100644 index 22ea736a..00000000 --- a/Crow/src/backends/win32/User32/Enums/ShowWindowCommand.cs +++ /dev/null @@ -1,83 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Used in to control - /// how a window is to be shown. - /// - public enum ShowWindowCommand - { - /// - /// Hides the window and activates another window. - /// - Hide = 0, - - /// - /// Activates and displays a window. If the window is minimized or maximized, the system restores it to - /// its original size and position. - /// An application should specify this flag when displaying the window for the first time. - /// - ShowNormal = 1, - - /// - /// Activates the window and displays it as a minimized window. - /// - ShowMinimized = 2, - - /// - /// Activates the window and displays it as a maximized window. - /// - ShowMaximized = 3, - - /// - /// Maximizes the specified window. - /// - Maximize = 3, - - /// - /// Displays a window in its most recent size and position. This value is similar to , - /// except that the window is not activated. - /// - ShowNoActivate = 4, - - /// - /// Activates the window and displays it in its current size and position. - /// - Show = 5, - - /// - /// Minimizes the specified window and activates the next top-level window in the Z order. - /// - Minimize = 6, - - /// - /// Displays the window as a minimized window. This value is similar to , - /// except the window is not activated. - /// - ShowMinimizedNoActivate = 7, - - /// - /// Displays the window in its current size and position. This value is similar to , - /// except the window is not activated. - /// - ShowNA = 8, - - /// - /// Activates and displays the window. If the window is minimized or maximized, the system restores it to - /// its original size and position. - /// An application should specify this flag when restoring a minimized window. - /// - Restore = 9, - - /// - /// Sets the show state based on the value specified in the STARTUPINFO - /// structure passed to the CreateProcess function by the program that started the application. - /// - ShowDefault = 10, - - /// - /// Windows 2000/XP: Minimizes a window, even if the thread that owns the window is not responding. - /// This flag should only be used when minimizing windows from a different thread. - /// - ForceMinimize = 11 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs b/Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs deleted file mode 100644 index e4a55ddc..00000000 --- a/Crow/src/backends/win32/User32/Enums/TrackMouseEvents.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used in to request specific services. - /// - [Flags] - public enum TrackMouseEvents : uint - { - /// - /// The caller wants hover notification. Notification is delivered as a - /// message. - /// If the caller requests hover tracking while hover tracking is already active, - /// the hover timer will be reset. - /// This flag is ignored if the mouse pointer is not over the specified window or area. - /// - Hover = 0x00000001, - - /// - /// The caller wants leave notification. Notification is delivered as a - /// message. If the mouse is not over the specified window or area, - /// a leave notification is generated immediately and no further tracking is performed. - /// - Leave = 0x00000002, - - /// - /// The caller wants hover and leave notification for the nonclient areas. - /// Notification is delivered as - /// and messages. - /// - NonClient = 0x00000010, - - /// - /// The function fills in the structure instead of treating it as a tracking request. - /// The structure is filled such that had that structure been passed to TrackMouseEvent, - /// it would generate the current tracking. The only anomaly is that the hover time-out - /// returned is always the actual time-out and not , if - /// was specified during the original - /// request. - /// - Query = 0x40000000, - - /// - /// The caller wants to cancel a prior tracking request. The caller should also specify the type - /// of tracking that it wants to cancel. For example, to cancel hover tracking, the caller must - /// pass the and flags. - /// - Cancel = 0x80000000 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/VirtualKey.cs b/Crow/src/backends/win32/User32/Enums/VirtualKey.cs deleted file mode 100644 index 40529d8e..00000000 --- a/Crow/src/backends/win32/User32/Enums/VirtualKey.cs +++ /dev/null @@ -1,874 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Lists all virtual keys. - /// - public enum VirtualKey : uint - { - /// - /// Left mouse button. - /// - LButton = 0x01, - - /// - /// Right mouse button. - /// - RButton = 0x02, - - /// - /// Control-break processing. - /// - Cancel = 0x03, - - /// - /// Middle mouse button (three-button mouse). - /// Not contiguous with L and R Button. - /// - MButton = 0x04, - - /// - /// X1 mouse button. - /// Not contiguous with L and R Button. - /// - XButton1 = 0x05, - - /// - /// X2 mouse button. - /// Not contiguous with L and R Button. - /// - XButton2 = 0x06, - - /* - * 0x07: Undefined - */ - - /// - /// BACKSPACE key. - /// - Back = 0x08, - - /// - /// TAB key. - /// - Tab = 0x09, - - /* - * 0x0A - 0x0B: Reserved - */ - - /// - /// CLEAR key. - /// - Clear = 0x0C, - - /// - /// ENTER key. - /// - Return = 0x0D, - - /* - * 0x0E - 0x0F: Undefined - */ - - /// - /// SHIFT key. - /// - Shift = 0x10, - - /// - /// CTRL key. - /// - Control = 0x11, - - /// - /// ALT key. - /// - Menu = 0x12, - - /// - /// PAUSE key. - /// - Pause = 0x13, - - /// - /// CAPS LOCK key - /// - Capital = 0x14, - - /// - /// IME Kana mode. - /// - Kana = 0x15, - - /// - /// IME Hanguel mode (maintained for compatibility; use ). - /// - Hangeul = 0x15, - - /// - /// IME Hangul mode. - /// - Hangul = 0x15, - - /* - * 0x16: Undefined - */ - - /// - /// IME Junja mode - /// - Junja = 0x17, - - /// - /// IME final mode. - /// - Final = 0x18, - - /// - /// IME Hanja mode. - /// - Hanja = 0x19, - - /// - /// IME Kanji mode. - /// - Kanji = 0x19, - - /* - * 0x1A: Undefined - */ - - /// - /// ESC key - /// - Escape = 0x1B, - - /// - /// IME convert. - /// - Convert = 0x1C, - - /// - /// IME nonconvert. - /// - NonConvert = 0x1D, - - /// - /// IME accept. - /// - Accept = 0x1E, - - /// - /// IME mode change request. - /// - ModeChange = 0x1F, - - /// - /// SPACEBAR. - /// - Space = 0x20, - - /// - /// PAGE UP key. - /// - Prior = 0x21, - - /// - /// PAGE DOWN key. - /// - Next = 0x22, - - /// - /// END key. - /// - End = 0x23, - - /// - /// HOME key. - /// - Home = 0x24, - - /// - /// LEFT ARROW key. - /// - Left = 0x25, - - /// - /// UP ARROW key. - /// - Up = 0x26, - - /// - /// RIGHT ARROW key. - /// - Right = 0x27, - - /// - /// DOWN ARROW key. - /// - Down = 0x28, - - /// - /// SELECT key. - /// - Select = 0x29, - - /// - /// PRINT key. - /// - Print = 0x2A, - - /// - /// EXECUTE key. - /// - Execute = 0x2B, - - /// - /// PRINT SCREEN key. - /// - Snapshot = 0x2C, - - /// - /// INS key. - /// - Insert = 0x2D, - - /// - /// DEL key. - /// - Delete = 0x2E, - - /// - /// HELP key. - /// - Help = 0x2F, - - /* - * 0 - 9 are the same as ASCII '0' - '9' (0x30 - 0x39) - * 0x40: Unassigned - * A - Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) - */ - - /// - /// Left Windows key (Natural keyboard). - /// - LWin = 0x5B, - - /// - /// Right Windows key (Natural keyboard). - /// - RWin = 0x5C, - - /// - /// Applications key (Natural keyboard). - /// - Apps = 0x5D, - - /* - * 0x5E: Reserved - */ - - /// - /// Computer Sleep key. - /// - Sleep = 0x5F, - - /// - /// Numeric keypad 0 key. - /// - Numpad0 = 0x60, - - /// - /// Numeric keypad 1 key - /// - Numpad1 = 0x61, - - /// - /// Numeric keypad 2 key - /// - Numpad2 = 0x62, - - /// - /// Numeric keypad 3 key - /// - Numpad3 = 0x63, - - /// - /// Numeric keypad 4 key - /// - Numpad4 = 0x64, - - /// - /// Numeric keypad 5 key - /// - Numpad5 = 0x65, - - /// - /// Numeric keypad 6 key - /// - Numpad6 = 0x66, - - /// - /// Numeric keypad 7 key - /// - Numpad7 = 0x67, - - /// - /// Numeric keypad 8 key - /// - Numpad8 = 0x68, - - /// - /// Numeric keypad 9 key - /// - Numpad9 = 0x69, - - /// - /// Multiply key. - /// - Multiply = 0x6A, - - /// - /// Add key. - /// - Add = 0x6B, - - /// - /// Separator key. - /// - Separator = 0x6C, - - /// - /// Subtract key. - /// - Subtract = 0x6D, - - /// - /// Decimal key. - /// - Decimal = 0x6E, - - /// - /// Divide key. - /// - Divide = 0x6F, - - /// - /// F1 key. - /// - F1 = 0x70, - - /// - /// F2 key. - /// - F2 = 0x71, - - /// - /// F3 key. - /// - F3 = 0x72, - - /// - /// F4 key. - /// - F4 = 0x73, - - /// - /// F5 key. - /// - F5 = 0x74, - - /// - /// F6 key. - /// - F6 = 0x75, - - /// - /// F7 key. - /// - F7 = 0x76, - - /// - /// F8 key. - /// - F8 = 0x77, - - /// - /// F9 key. - /// - F9 = 0x78, - - /// - /// F10 key. - /// - F10 = 0x79, - - /// - /// F11 key. - /// - F11 = 0x7A, - - /// - /// F12 key. - /// - F12 = 0x7B, - - /// - /// F13 key. - /// - F13 = 0x7C, - - /// - /// F14 key. - /// - F14 = 0x7D, - - /// - /// F15 key. - /// - F15 = 0x7E, - - /// - /// F16 key. - /// - F16 = 0x7F, - - /// - /// F17 key. - /// - F17 = 0x80, - - /// - /// F18 key. - /// - F18 = 0x81, - - /// - /// F19 key. - /// - F19 = 0x82, - - /// - /// F20 key. - /// - F20 = 0x83, - - /// - /// F21 key. - /// - F21 = 0x84, - - /// - /// F22 key. - /// - F22 = 0x85, - - /// - /// F23 key. - /// - F23 = 0x86, - - /// - /// F24 key. - /// - F24 = 0x87, - - /* - * 0x88 - 0x8F: Unassigned - */ - - /// - /// NUM LOCK key. - /// - NumLock = 0x90, - - /// - /// SCROLL LOCK key. - /// - Scroll = 0x91, - - /* - * 0x92 - 0x96: OEM specific - */ - - /* - * 0x97 - 0x9F: Unassigned - */ - - /* - * L* & R* - left and right Alt, Ctrl and Shift virtual keys. - * Used only as parameters to GetAsyncKeyState() and GetKeyState(). - * No other API or message will distinguish left and right keys in this way. - */ - - /// - /// Left SHIFT key. - /// - LShift = 0xA0, - - /// - /// Right SHIFT key. - /// - RShift = 0xA1, - - /// - /// Left CONTROL key. - /// - LControl = 0xA2, - - /// - /// Right CONTROL key. - /// - RControl = 0xA3, - - /// - /// Left MENU key. - /// - LMenu = 0xA4, - - /// - /// Right MENU key. - /// - RMenu = 0xA5, - - /// - /// Browser Back key. - /// - BrowserBack = 0xA6, - - /// - /// Browser Forward key - /// - BrowserForward = 0xA7, - - /// - /// Browser Refresh key. - /// - BrowserRefresh = 0xA8, - - /// - /// Browser Stop key. - /// - BrowserStop = 0xA9, - - /// - /// Browser Search key. - /// - BrowserSearch = 0xAA, - - /// - /// Browser Favorites key. - /// - BrowserFavorites = 0xAB, - - /// - /// Browser Start and Home key. - /// - BrowserHome = 0xAC, - - /// - /// Volume Mute key. - /// - VolumeMute = 0xAD, - - /// - /// Volume Down key. - /// - VolumeDown = 0xAE, - - /// - /// Volume Up key. - /// - VolumeUp = 0xAF, - - /// - /// Next Track key. - /// - MediaNextTrack = 0xB0, - - /// - /// Previous Track key. - /// - MediaPreviousTrack = 0xB1, - - /// - /// Stop Media key. - /// - MediaStop = 0xB2, - - /// - /// Play/Pause Media key. - /// - MediaPlayPause = 0xB3, - - /// - /// Start Mail key. - /// - LaunchMail = 0xB4, - - /// - /// Select Media key. - /// - LaunchMediaSelect = 0xB5, - - /// - /// Start Application 1 key. - /// - LaunchApp1 = 0xB6, - - /// - /// Start Application 2 key. - /// - LaunchApp2 = 0xB7, - - /* - * 0xB8 - 0xB9 : reserved - */ - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// For the US standard keyboard, the ';:' key. - /// - Oem1 = 0xBA, - - /// - /// For any country/region, the '+' key. - /// - OemPlus = 0xBB, - - /// - /// For any country/region, the ',' key. - /// - OemComma = 0xBC, - - /// - /// For any country/region, the '-' key. - /// - OemMinus = 0xBD, - - /// - /// For any country/region, the '.' key. - /// - OemPeriod = 0xBE, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// For the US standard keyboard, the '/?' key. - /// - Oem2 = 0xBF, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// For the US standard keyboard, the '`~' key. - /// - Oem3 = 0xC0, - - /* - * 0xC1 - 0xD7: Reserved - */ - - /* - * 0xD8 - 0xDA: Unassigned - */ - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// For the US standard keyboard, the '[{' key - /// - Oem4 = 0xDB, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// For the US standard keyboard, the '\|' key - /// - Oem5 = 0xDC, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// For the US standard keyboard, the ']}' key - /// - Oem6 = 0xDD, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// For the US standard keyboard, the 'single-quote/double-quote' key - /// - Oem7 = 0xDE, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// - Oem8 = 0xDF, - - /* - * 0xE0: Reserved - */ - - /* - * Various extended or enhanced keyboards - */ - - /// - /// OEM specific. - /// 'AX' key on Japanese AX keyboard. - /// - OemAX = 0xE1, - - /// - /// Either the angle bracket key or the backslash key on the RT 102-key keyboard. - /// - Oem102 = 0xE2, - - /// - /// OEM specific. - /// Help key on ICO. - /// - IcoHelp = 0xE3, - - /// - /// OEM specific. - /// 00 key on ICO. - /// - Ico00 = 0xE4, - - /// - /// IME PROCESS key. - /// - ProcessKey = 0xE5, - - /// - /// OEM specific. - /// Clear key on ICO. - /// - IcoClear = 0xE6, - - /// - /// Used to pass Unicode characters as if they were keystrokes. The key is - /// the low word of a 32-bit Virtual Key value used for non-keyboard input methods. - /// - Packet = 0xE7, - - /* - * 0xE8: Unassigned - */ - - /* - * Nokia/Ericsson definitions - */ - - /// - /// OEM specific Reset key. - /// - OemReset = 0xE9, - - /// - /// OEM specific Jump key. - /// - OemJump = 0xEA, - - /// - /// OEM specific PA1 key. - /// - OemPA1 = 0xEB, - - /// - /// OEM specific PA2 key. - /// - OemPA2 = 0xEC, - - /// - /// OEM specific PA3 key. - /// - OemPA3 = 0xED, - - /// - /// OEM specific WSCtrl key. - /// - OemWSCtrl = 0xEE, - - /// - /// OEM specific CUseL key. - /// - OemCUseL = 0xEF, - - /// - /// OEM specific attn key. - /// - OemAttn = 0xF0, - - /// - /// OEM specific Finish key. - /// - OemFinish = 0xF1, - - /// - /// OEM specific Copy key. - /// - OemCopy = 0xF2, - - /// - /// OEM specific Auto key. - /// - OemAuto = 0xF3, - - /// - /// OEM specific Enlw key. - /// - OemEnlw = 0xF4, - - /// - /// OEM specific Backtab key. - /// - OemBacktab = 0xF5, - - /// - /// Attn key. - /// - Attn = 0xF6, - - /// - /// CrSel key. - /// - CrSel = 0xF7, - - /// - /// ExSel key. - /// - ExSel = 0xF8, - - /// - /// Erase EOF key. - /// - ErEof = 0xF9, - - /// - /// Play key. - /// - Play = 0xFA, - - /// - /// Zoom key. - /// - Zoom = 0xFB, - - /// - /// Reserved. - /// - NoName = 0xFC, - - /// - /// PA1 key. - /// - PA1 = 0xFD, - - /// - /// Clear key. - /// - OemClear = 0xFE, - - /// - /// The highest possible value for virtual keys. - /// - Last = 0xFF, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs b/Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs deleted file mode 100644 index b3f9d5f4..00000000 --- a/Crow/src/backends/win32/User32/Enums/WindowClassStyles.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Defines additional elements of the window class. - /// - [Flags] - public enum WindowClassStyles : uint - { - /// - /// Redraws the entire window if a movement or size adjustment changes the height of the client area. - /// - VRedraw = 0x0001, - - /// - /// Redraws the entire window if a movement or size adjustment changes the width of the client area. - /// - HRedraw = 0x0002, - - /// - /// Sends a double-click message to the window procedure when the user double-clicks - /// the mouse while the cursor is within a window belonging to the class. - /// - DoubleClicks = 0x0008, - - /// - /// Allocates a unique device context for each window in the class. - /// - OwnDeviceContext = 0x0020, - - /// - /// Allocates one device context to be shared by all windows in the class. Because window classes are process - /// specific, it is possible for multiple threads of an application to create a window of the same class. - /// It is also possible for the threads to attempt to use the device context simultaneously. When this - /// happens, the system allows only one thread to successfully finish its drawing operation. - /// - ClassDeviceContext = 0x0040, - - /// - /// Sets the clipping rectangle of the child window to that of the parent window so that the child can draw on - /// the parent. A window with the style bit receives a regular device context - /// from the system's cache of device contexts. It does not give the child the parent's device context or - /// device context settings. Specifying enhances an application's - /// performance. - /// - ParentDeviceContext = 0x0080, - - /// - /// Disables Close on the window menu. - /// - NoClose = 0x0200, - - /// - /// Saves, as a bitmap, the portion of the screen image obscured by a window of this class. When the window is - /// removed, the system uses the saved bitmap to restore the screen image, including other windows that were - /// obscured. Therefore, the system does not send to windows that were - /// obscured if the memory used by the bitmap has not been discarded and if other screen actions - /// have not invalidated the stored image. - /// This style is useful for small windows (for example, menus or dialog boxes) that are displayed briefly - /// and then removed before other screen activity takes place. This style increases the time required to - /// display the window, because the system must first allocate memory to store the bitmap. - /// - SaveBits = 0x0800, - - /// - /// Aligns the window's client area on a byte boundary (in the x direction). - /// This style affects the width of the window and its horizontal placement on the display. - /// - ByteAlignClient = 0x1000, - - /// - /// Aligns the window on a byte boundary (in the x direction). - /// This style affects the width of the window and its horizontal placement on the display. - /// - ByteAlignWindow = 0x2000, - - /// - /// Indicates that the window class is an application global class. For more information, see the - /// "Application Global Classes" section of About Window Classes. - /// - GlobalClass = 0x4000, - - /// - /// This member is not officially documented. Use with care. - /// - Ime = 0x00010000, - - /// - /// Enables the drop shadow effect on a window. The effect is turned on and off through SPI_SETDROPSHADOW. - /// Typically, this is enabled for small, short-lived windows such as menus to emphasize their Z-order - /// relationship to other windows. Windows created from a class with this style must be top-level windows; - /// they may not be child windows. - /// - DropShadow = 0x00020000 - } -} diff --git a/Crow/src/backends/win32/User32/Enums/WindowMessage.cs b/Crow/src/backends/win32/User32/Enums/WindowMessage.cs deleted file mode 100644 index cb7be8b6..00000000 --- a/Crow/src/backends/win32/User32/Enums/WindowMessage.cs +++ /dev/null @@ -1,1661 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies the different types of window messages. - /// - public enum WindowMessage : uint - { - /// - /// Performs no operation. An application sends the message if it wants to - /// post a message that the recipient window will ignore. - /// - Null = 0x0000, - - /// - /// Sent when an application requests that a window be created by calling the - /// or CreateWindow function. - /// (The message is sent before the function returns.) The window procedure of the - /// new window receives this message after the window is created, but before the window becomes visible. - /// - Create = 0x0001, - - /// - /// Sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed - /// after the window is removed from the screen. - /// This message is sent first to the window being destroyed and then to the child windows (if any) as they - /// are destroyed. During the processing of the message, it can be assumed that all child windows still exist. - /// - Destroy = 0x0002, - - /// - /// Sent after a window has been moved. - /// - Move = 0x0003, - - /// - /// Sent to a window after its size has changed. - /// - Size = 0x0005, - - /// - /// Sent to both the window being activated and the window being deactivated. If the windows use the same - /// input queue, the message is sent synchronously, first to the window procedure of the top-level window being - /// deactivated, then to the window procedure of the top-level window being activated. If the windows use - /// different input queues, the message is sent asynchronously, so the window is activated immediately. - /// - Activate = 0x0006, - - /// - /// Sent to a window after it has gained the keyboard focus. - /// - SetFocus = 0x0007, - - /// - /// Sent to a window immediately before it loses the keyboard focus. - /// - KillFocus = 0x0008, - - /// - /// Sent when an application changes the enabled state of a window. It is sent to the window whose enabled - /// state is changing. This message is sent before the EnableWindow function returns, but after the enabled - /// state ( style bit) of the window has changed. - /// - Enable = 0x000A, - - /// - /// An application sends the message to a window to allow changes in that window - /// to be redrawn or to prevent changes in that window from being redrawn. - /// - SetRedraw = 0x000B, - - /// - /// Sets the text of a window. - /// - SetText = 0x000C, - - /// - /// Copies the text that corresponds to a window into a buffer provided by the caller. - /// - GetText = 0x000D, - - /// - /// Determines the length, in characters, of the text associated with a window. - /// - GetTextLength = 0x000E, - - /// - /// Sent when the system or another application makes a request to paint a portion of an application's window. - /// The message is sent when the UpdateWindow or RedrawWindow function is called, or by the - /// function when the application obtains a - /// message by using the - /// or - /// function. - /// - Paint = 0x000F, - - /// - /// Sent as a signal that a window or an application should terminate. - /// - Close = 0x0010, - - /// - /// Sent when the user chooses to end the session or when an application calls one of the system shutdown - /// functions. If any application returns zero, the session is not ended. The system stops sending - /// messages as soon as one application returns zero. - /// - QueryEndSession = 0x0011, - - /// - /// Indicates a request to terminate an application, and is generated when the application calls the - /// function. This message causes the - /// function to return zero. - /// - Quit = 0x0012, - - /// - /// Sent to an icon when the user requests that the window be restored to its previous size and position. - /// - QueryOpen = 0x0013, - - /// - /// Sent when the window background must be erased (for example, when a window is resized). - /// The message is sent to prepare an invalidated portion of a window for painting. - /// - EraseBackground = 0x0014, - - /// - /// The message is sent to all top-level windows when - /// a change is made to a system color setting. - /// - SystemColorChange = 0x0015, - - /// - /// Sent to an application after the system processes the results of the message. - /// The message informs the application whether the session is ending. - /// - EndSession = 0x0016, - - /// - /// Sent to a window when the window is about to be hidden or shown. - /// - ShowWindow = 0x0018, - - /// - /// Sent by an application to all top-level windows after making a change to the - /// WIN.INI file. The SystemParametersInfo function sends this message - /// after an application uses the function to change a setting in WIN.INI. - /// - WinIniChange = 0x001A, - - /// - /// A message that is sent to all top-level windows when the SystemParametersInfo function changes - /// a system-wide setting or when policy settings have changed. - /// Applications should send to all top-level windows when they make changes to - /// system parameters. (This message cannot be sent directly to a window.) To send the - /// message to all top-level windows, use the SendMessageTimeout function with the - /// hwnd parameter set to . - /// - SettingChange = WinIniChange, - - /// - /// Sent to all top-level windows whenever the user changes device-mode settings. - /// - DeviceModeChange = 0x001B, - - /// - /// Sent when a window belonging to a different application than the active window is about to be activated. - /// The message is sent to the application whose window is being activated - /// and to the application whose window is being deactivated. - /// - ActivateApp = 0x001C, - - /// - /// Sent to all top-level windows in the system after changing the pool of font resources. - /// - FontChange = 0x001D, - - /// - /// A message that is sent whenever there is a change in the system time. - /// - TimeChange = 0x001E, - - /// - /// Sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the - /// active window when a dialog box or message box is displayed. Certain functions also send this message - /// explicitly to the specified window regardless of whether it is the active window. For example, - /// the EnableWindow function sends this message when disabling the specified window. - /// - CancelMode = 0x001F, - - /// - /// Sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. - /// - SetCursor = 0x0020, - - /// - /// Sent when the cursor is in an inactive window and the user presses a mouse button. The parent window - /// receives this message only if the child window passes it to the - /// - /// function. - /// - MouseActivate = 0x0021, - - /// - /// Sent to a child window when the user clicks the window's title bar or - /// when the window is activated, moved, or sized. - /// - ChildActivate = 0x0022, - - /// - /// Sent by a computer-based training (CBT) application to separate user-input messages - /// from other messages sent through the WH_JOURNALPLAYBACK procedure. - /// - QueueSync = 0x0023, - - /// - /// Sent to a window when the size or position of the window is about to change. An application can use - /// this message to override the window's default maximized size and position, - /// or its default minimum or maximum tracking size. - /// - GetMinMaxInfo = 0x0024, - - /// - /// Obsolete. Used in Windows NT 3.51 and earlier. - /// - PaintIcon = 0x0026, - - /// - /// Obsolete. Used in Windows NT 3.51 and earlier. - /// - IconEraseBackground = 0x0027, - - /// - /// Sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. - /// - NextDialogCtl = 0x0028, - - /// - /// Sent from Print Manager whenever a job is added to or removed from the Print Manager queue. - /// - SpoolerStatus = 0x002A, - - /// - /// Sent to the parent window of an owner-drawn button, combo box, list box, or menu when a - /// visual aspect of the button, combo box, list box, or menu has changed. - /// - DrawItem = 0x002B, - - /// - /// Sent to the owner window of a combo box, list box, list view control, or menu item when - /// the control or menu is created. - /// - MeasureItem = 0x002C, - - /// - /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items - /// are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. - /// The system sends a message for each deleted item. The system sends the - /// message for any deleted list box or combo box item with nonzero item data. - /// - DeleteItem = 0x002D, - - /// - /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its - /// owner in response to a message. - /// - VKeyToItem = 0x002E, - - /// - /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its - /// owner in response to a message. - /// - CharToItem = 0x002F, - - /// - /// Sent to specify the font that a control is to use when drawing text. - /// - SetFont = 0x0030, - - /// - /// Sent to a control to retrieve the font with which the control is currently drawing its text. - /// - GetFont = 0x0031, - - /// - /// Sent to a window to associate a hot key with the window. - /// When the user presses the hot key, the system activates the window. - /// - SetHotkey = 0x0032, - - /// - /// Sent to determine the hot key associated with a window. - /// - GetHotkey = 0x0033, - - /// - /// Sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an - /// icon defined for its class. An application can return a handle to an icon or cursor. - /// The system displays this cursor or icon while the user drags the icon. - /// - QueryDragIcon = 0x0037, - - /// - /// Sent to determine the relative position of a new item in the sorted list of an owner-drawn combo box or - /// list box. Whenever the application adds a new item, the system sends this message to the owner of a - /// combo box or list box created with the CBS_SORT or LBS_SORT style. - /// - CompareItem = 0x0039, - - /// - /// Sent by Active Accessibility to obtain information about an accessible object contained in a server - /// application. Applications never send this message directly. It is sent only by Active Accessibility - /// in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or - /// AccessibleObjectFromWindow. However, server applications handle this message. - /// - GetObject = 0x003D, - - /// - /// Sent to all top-level windows when the system detects more than 12.5 percent of system time over a - /// 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low. - /// - Compacting = 0x0041, - - /// - /// Marked as "no longer supported" and not officially documented. Use with care. - /// - CommNotify = 0x0044, - - /// - /// Sent to a window whose size, position, or place in the Z order is about to change as a result of a - /// call to the function or another window-management function. - /// - WindowPosChanging = 0x0046, - - /// - /// Sent to a window whose size, position, or place in the Z order has changed as a result of a call to the - /// function or another window-management function. - /// - WindowPosChanged = 0x0047, - - /// - /// Notifies applications that the system, typically a battery-powered personal computer, - /// is about to enter a suspended mode. - /// Obsolete : use instead. - /// - Power = 0x0048, - - /// - /// Sent to pass data to another application. - /// - CopyData = 0x004A, - - /// - /// Posted to an application when a user cancels the application's journaling activities. - /// The message is posted with a null/zero window handle. - /// - CancelJournal = 0x004B, - - /// - /// Sent by a common control to its parent window when an event has occurred - /// or the control requires some information. - /// - Notify = 0x004E, - - /// - /// Posted to the window with the focus when the user chooses a new input language, either with the hotkey - /// (specified in the Keyboard control panel application) or from the indicator on the system taskbar. - /// An application can accept the change by passing the message to the - /// - /// function or reject the change (and prevent it from taking place) by returning immediately. - /// - InputLanguageChangeRequest = 0x0050, - - /// - /// Sent to the topmost affected window after an application's input language has been changed. You should - /// make any application-specific settings and pass the message to the - /// - /// function, which passes the message to all first-level child windows. These child windows can pass the - /// message to - /// - /// to have it pass the message to their child windows, and so on. - /// - InputLanguageChange = 0x0051, - - /// - /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs - /// the application when the user clicks an authorable button. An application initiates a training card by - /// specifying the HELP_TCARD command in a call to the WinHelp function. - /// - TCard = 0x0052, - - /// - /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, is - /// sent to the window associated with the menu; otherwise, is sent to the window that has - /// the keyboard focus. If no window has the keyboard focus, is sent to the currently - /// active window. - /// - Help = 0x0053, - - /// - /// Sent to all windows after the user has logged on or off. When the user logs on or off, the system updates - /// the user-specific settings. The system sends this message immediately after updating the settings. - /// - UserChanged = 0x0054, - - /// - /// Determines if a window accepts ANSI or Unicode structures in the notification message. - /// messages are sent from a common control to its parent window - /// and from the parent window to the common control. - /// - NotifyFormat = 0x0055, - - /// - /// Notifies a window that the user clicked the right mouse button (right-clicked) in the window. - /// - ContextMenu = 0x007B, - - /// - /// Sent to a window when the - /// function is about to change one or more of the window's styles. - /// - StyleChanging = 0x007C, - - /// - /// Sent to a window after the - /// function has changed one or more of the window's styles. - /// - StyleChanged = 0x007D, - - /// - /// Sent to all windows when the display resolution has changed. - /// - DisplayChange = 0x007E, - - /// - /// Sent to a window to retrieve a handle to the large or small icon associated with a window. - /// The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. - /// - GetIcon = 0x007F, - - /// - /// Sent by an application to associate a new large or small icon with a window. The system displays the - /// large icon in the ALT+TAB dialog box, and the small icon in the window caption. - /// - SetIcon = 0x0080, - - /// - /// Sent prior to the message when a window is first created. - /// - NCCreate = 0x0081, - - /// - /// Informs a window that its nonclient area is being destroyed. The - /// function sends the message - /// to the window following the message. - /// is used to free the allocated memory object associated with the window. - /// - NCDestroy = 0x0082, - - /// - /// Sent when the size and position of a window's client area must be calculated. By processing this message, - /// an application can control the content of the window's client area when - /// the size or position of the window changes. - /// - NCCalcSize = 0x0083, - - /// - /// Sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is - /// not captured, the message is sent to the window beneath the cursor. - /// Otherwise, the message is sent to the window that has captured the mouse. - /// - NCHitTest = 0x0084, - - /// - /// Sent to a window when its frame must be painted. - /// - NCPaint = 0x0085, - - /// - /// Non Client Area Activated Caption (Title) of the Form. - /// - NCActivate = 0x0086, - - /// - /// Sent to the window procedure associated with a control. By default, the system handles all keyboard input - /// to the control; the system interprets certain types of keyboard input as dialog box navigation keys. - /// To override this default behavior, the control can respond to the message to - /// indicate the types of input it wants to process itself. - /// - GetDialogCode = 0x0087, - - /// - /// Used to synchronize painting while avoiding linking independent GUI threads. - /// - SyncPaint = 0x0088, - - /// - /// Posted to a window when the cursor is moved within the nonclient area of the window. This message is posted - /// to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCMouseMove = 0x00A0, - - /// - /// Posted when the user presses the left mouse button while the cursor is within the nonclient area of a - /// window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCLButtonDown = 0x00A1, - - /// - /// Posted when the user releases the left mouse button while the cursor is within the nonclient area of a - /// window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCLButtonUp = 0x00A2, - - /// - /// Posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area - /// of a window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCLButtonDoubleClick = 0x00A3, - - /// - /// Posted when the user presses the right mouse button while the cursor is within the nonclient area of a - /// window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCRButtonDown = 0x00A4, - - /// - /// Posted when the user releases the right mouse button while the cursor is within the nonclient area of a - /// window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCRButtonUp = 0x00A5, - - /// - /// Posted when the user double-clicks the right mouse button while the cursor is within the nonclient area - /// of a window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCRButtonDoubleClick = 0x00A6, - - /// - /// Posted when the user presses the middle mouse button while the cursor is within the nonclient area of a - /// window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCMButtonDown = 0x00A7, - - /// - /// Posted when the user releases the middle mouse button while the cursor is within the nonclient area of a - /// window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCMButtonUp = 0x00A8, - - /// - /// Posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area - /// of a window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCMButtonDoubleClick = 0x00A9, - - /// - /// Posted when the user presses the first or second X button while the cursor is within the nonclient area - /// of a window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCXButtonDown = 0x00AB, - - /// - /// Posted when the user releases the first or second X button while the cursor is within the nonclient area - /// of a window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCXButtonUp = 0x00AC, - - /// - /// Posted when the user double-clicks the first or second X button while the cursor is within the nonclient - /// area of a window. This message is posted to the window that contains the cursor. - /// If a window has captured the mouse, this message is not posted. - /// - NCXButtonDoubleClick = 0x00AD, - - /// - /// Sent to the window that registered to receive raw input. - /// - InputDeviceChange = 0x00FE, - - /// - /// Sent to the window that is getting raw input. - /// - Input = 0x00FF, - - /// - /// Posted to the window with the keyboard focus when a nonsystem key is pressed. - /// A nonsystem key is a key that is pressed when the ALT key is not pressed. - /// - KeyDown = 0x0100, - - /// - /// This message filters for keyboard messages. - /// - KeyFirst = 0x0100, - - /// - /// Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key - /// that is pressed when the ALT key is not pressed, - /// or a keyboard key that is pressed when a window has the keyboard focus. - /// - KeyUp = 0x0101, - - /// - /// Posted to the window with the keyboard focus when a message is translated by the - /// TranslateMessage function. The message contains - /// the character code of the key that was pressed. - /// - Char = 0x0102, - - /// - /// Posted to the window with the keyboard focus when a message is translated by the - /// TranslateMessage function. specifies a character code generated by a dead key. - /// A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with - /// another character to form a composite character. For example, the umlaut-O character (Ö) is generated - /// by typing the dead key for the umlaut character, and then typing the O key. - /// - DeadChar = 0x0103, - - /// - /// Posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu - /// bar) or holds down the ALT key and then presses another key. It also occurs when no window currently - /// has the keyboard focus; in this case, the message is sent to the active window. - /// The window that receives the message can distinguish between these two contexts by - /// checking the context code in the lParam parameter. - /// - SystemKeyDown = 0x0104, - - /// - /// Posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT - /// key was held down. It also occurs when no window currently has the keyboard focus; in this case, the - /// message is sent to the active window. The window that receives the message can - /// distinguish between these two contexts by checking the context code in the lParam parameter. - /// - SystemKeyUp = 0x0105, - - /// - /// Posted to the window with the keyboard focus when a message is translated by - /// the TranslateMessage function. It specifies the character code of a system character key — that is, a - /// character key that is pressed while the ALT key is down. - /// - SystemChar = 0x0106, - - /// - /// Sent to the window with the keyboard focus when a message is translated by the - /// TranslateMessage function. specifies the character code of a system dead key - /// — that is, a dead key that is pressed while holding down the ALT key. - /// - SystemDeadChar = 0x0107, - - /// - /// Can be used by an application to post input to other windows. This message contains the character code - /// of the key that was pressed. (Test whether a target app can process messages - /// by sending the message with wParam set to UNICODE_NOCHAR.) - /// - UnicodeCharacter = 0x0109, - - /// - /// This message filters for keyboard messages. - /// - KeyLast = 0x0109, - - /// - /// Sent immediately before the IME generates the composition string as a result of a keystroke. - /// - ImeStartComposition = 0x010D, - - /// - /// Sent to an application when the IME ends composition. - /// - ImeEndComposition = 0x010E, - - /// - /// Sent to an application when the IME changes composition status as a result of a keystroke. - /// - ImeComposition = 0x010F, - - /// - /// Same as . Documentation incomplete. - /// - ImeKeylast = 0x010F, - - /// - /// Sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures - /// typically use this message to initialize controls and carry out any other - /// initialization tasks that affect the appearance of the dialog box. - /// - InitDialog = 0x0110, - - /// - /// Sent when the user selects a command item from a menu, when a control sends a notification message - /// to its parent window, or when an accelerator keystroke is translated. - /// - Command = 0x0111, - - /// - /// A window receives this message when the user chooses a command from the Window menu (formerly known - /// as the system or control menu) or when the user chooses the maximize button, minimize button, - /// restore button, or close button. - /// - SystemCommand = 0x0112, - - /// - /// Posted to the installing thread's message queue when a timer expires. - /// The message is posted by the or - /// function. - /// - Timer = 0x0113, - - /// - /// Sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. - /// This message is also sent to the owner of a horizontal scroll bar control - /// when a scroll event occurs in the control. - /// - HScroll = 0x0114, - - /// - /// Sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message - /// is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. - /// - VScroll = 0x0115, - - /// - /// Sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or - /// presses a menu key. This allows the application to modify the menu before it is displayed. - /// - InitMenu = 0x0116, - - /// - /// Sent when a drop-down menu or submenu is about to become active. This allows an application to modify - /// the menu before it is displayed, without changing the entire menu. - /// - InitMenuPopup = 0x0117, - - /// - /// Passes information about a gesture. - /// Only supported on Windows 7 and higher. - /// - Gesture = 0x0119, - - /// - /// Gives you a chance to set the gesture configuration. - /// Only supported on Windows 7 and higher. - /// - GestureNotify = 0x011A, - - /// - /// Sent to a menu's owner window when the user selects a menu item. - /// - MenuSelect = 0x011F, - - /// - /// Sent when a menu is active and the user presses a key that does not correspond to any mnemonic - /// or accelerator key. This message is sent to the window that owns the menu. - /// - MenuChar = 0x0120, - - /// - /// Sent to the owner window of a modal dialog box or menu that is entering an idle state. - /// A modal dialog box or menu enters an idle state when no messages are waiting in its queue - /// after it has processed one or more previous messages. - /// - EnterIdle = 0x0121, - - /// - /// Sent when the user releases the right mouse button while the cursor is on a menu item. - /// - MenuRButtonUp = 0x0122, - - /// - /// Sent to the owner of a drag-and-drop menu when the user drags a menu item. - /// - MenuDrag = 0x0123, - - /// - /// Sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves - /// from the center of the item to the top or bottom of the item. - /// - MenuGetObject = 0x0124, - - /// - /// Sent when a drop-down menu or submenu has been destroyed. - /// - UninitMenuPopup = 0x0125, - - /// - /// Sent when the user makes a selection from a menu. - /// - MenuCommand = 0x0126, - - /// - /// Sent by an application to indicate that the UI state should be changed. - /// - ChangeUIState = 0x0127, - - /// - /// Sent by an application to change the UI state for the specified window and all its child windows. - /// - UpdateUIState = 0x0128, - - /// - /// Sent by an application to retrieve the UI state for a window. - /// - QueryUIState = 0x0129, - - /// - /// Sent to the owner window of a message box before Windows draws the message box. By responding to this - /// message, the owner window can set the text and background colors of the message box - /// by using the given display device context handle. - /// - CtlColorMsgBox = 0x0132, - - /// - /// An edit control that is not read-only or disabled sends the message to its - /// parent window when the control is about to be drawn. By responding to this message, the parent window - /// can use the specified device context handle to set the text and background colors of the edit control. - /// - CtlColorEdit = 0x0133, - - /// - /// Sent to the parent window of a list box before the system draws the list box. By responding to this - /// message, the parent window can set the text and background colors of the list box - /// by using the specified display device context handle. - /// - CtlColorListBox = 0x0134, - - /// - /// Sent to the parent window of a button before drawing the button. The parent window can change - /// the button's text and background colors. However, only owner-drawn buttons - /// respond to the parent window processing this message. - /// - CtlColorButton = 0x0135, - - /// - /// Sent to a dialog box before the system draws the dialog box. By responding to this message, - /// the dialog box can set its text and background colors using the specified display device context handle. - /// - CtlColorDialog = 0x0136, - - /// - /// Sent to the parent window of a scroll bar control when the control is about to be drawn. - /// By responding to this message, the parent window can use the display context handle - /// to set the background color of the scroll bar control. - /// - CtlColorScrollbar = 0x0137, - - /// - /// A static control, or an edit control that is read-only or disabled, sends the - /// message to its parent window when the control is about to be drawn. - /// By responding to this message, the parent window can use the specified device context handle - /// to set the text and background colors of the static control. - /// - CtlColorStatic = 0x0138, - - /// - /// Retrieves the menu handle for the current window. - /// - GetHMenu = 0x01E1, - - /// - /// Posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window - /// that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse. - /// - MouseMove = 0x0200, - - /// - /// Use to specify the first mouse message. Use the - /// function. - /// - MouseFirst = 0x0200, - - /// - /// Posted when the user presses the left mouse button while the cursor is in the client area of a window. - /// If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - LButtonDown = 0x0201, - - /// - /// Posted when the user releases the left mouse button while the cursor is in the client area of a window. - /// If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - LButtonUp = 0x0202, - - /// - /// Posted when the user double-clicks the left mouse button while the cursor is in the client area of a - /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - LButtonDoubleClick = 0x0203, - - /// - /// Posted when the user presses the right mouse button while the cursor is in the client area of a window. - /// If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - RButtonDown = 0x0204, - - /// - /// Posted when the user releases the right mouse button while the cursor is in the client area of a window. - /// If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - RButtonUp = 0x0205, - - /// - /// Posted when the user double-clicks the right mouse button while the cursor is in the client area of a - /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - RButtonDoubleClick = 0x0206, - - /// - /// Posted when the user presses the middle mouse button while the cursor is in the client area of a window. - /// If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - MButtonDown = 0x0207, - - /// - /// Posted when the user releases the middle mouse button while the cursor is in the client area of a window. - /// If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - MButtonUp = 0x0208, - - /// - /// Posted when the user double-clicks the middle mouse button while the cursor is in the client area of a - /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - MButtonDoubleClick = 0x0209, - - /// - /// Sent to the focus window when the mouse wheel is rotated. The - /// - /// function propagates the message to the window's parent. There should be no internal forwarding of the - /// message, since - /// - /// propagates it up the parent chain until it finds a window that processes it. - /// - MouseWheel = 0x020A, - - /// - /// Posted when the user presses the first or second X button while the cursor is in the client area of a - /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, - /// the message is posted to the window that has captured the mouse. - /// - XButtonDown = 0x020B, - - /// - /// Posted when the user releases the first or second X button while the cursor is in the client area of a - /// window. If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - XButtonUp = 0x020C, - - /// - /// Posted when the user double-clicks the first or second X button while the cursor is in the client area of - /// a window. If the mouse is not captured, the message is posted to the window beneath the cursor. - /// Otherwise, the message is posted to the window that has captured the mouse. - /// - XButtonDoubleClick = 0x020D, - - /// - /// Sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The - /// - /// function propagates the message to the window's parent. There should be no internal forwarding of the - /// message, since - /// - /// propagates it up the parent chain until it finds a window that processes it. - /// - MouseHWheel = 0x020E, - - /// - /// Same as . Documentation incomplete. - /// - MouseLast = 0x020E, - - /// - /// Sent to the parent of a child window when the child window is created or destroyed, or when the user - /// clicks a mouse button while the cursor is over the child window. When the child window is being created, - /// the system sends just before the CreateWindow or - /// - /// function that creates the window returns. When the child window is being destroyed, the system sends the - /// message before any processing to destroy the window takes place. - /// - ParentNotify = 0x0210, - - /// - /// Informs an application's main window procedure that a menu modal loop has been entered. - /// - EnterMenuLoop = 0x0211, - - /// - /// Informs an application's main window procedure that a menu modal loop has been exited. - /// - ExitMenuLoop = 0x0212, - - /// - /// Sent to an application when the right or left arrow key is used - /// to switch between the menu bar and the system menu. - /// - NextMenu = 0x0213, - - /// - /// Sent to a window that the user is resizing. By processing this message, an application can monitor - /// the size and position of the drag rectangle and, if needed, change its size or position. - /// - Sizing = 0x0214, - - /// - /// Sent to the window that is losing the mouse capture. - /// - CaptureChanged = 0x0215, - - /// - /// Sent to a window that the user is moving. By processing this message, an application can monitor - /// the position of the drag rectangle and, if needed, change its position. - /// - Moving = 0x0216, - - /// - /// Notifies applications that a power-management event has occurred. - /// - PowerBroadcast = 0x0218, - - /// - /// Notifies an application of a change to the hardware configuration of a device or the computer. - /// - DeviceChange = 0x0219, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to create an MDI child window. - /// - MdiCreate = 0x0220, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to close an MDI child window. - /// - MdiDestroy = 0x0221, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to instruct the client window - /// to activate a different MDI child window. - /// - MdiActivate = 0x0222, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to restore an MDI child - /// window from maximized or minimized size. - /// - MdiRestore = 0x0223, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to activate the - /// next or previous child window. - /// - MdiNext = 0x0224, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to maximize an MDI - /// child window. The system resizes the child window to make its client area fill the client window. The - /// system places the child window's window menu icon in the rightmost position of the frame window's menu bar, - /// and places the child window's restore icon in the leftmost position. The system also appends the title bar - /// text of the child window to that of the frame window. - /// - MdiMaximize = 0x0225, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to arrange all of its MDI - /// child windows in a tile format. - /// - MdiTile = 0x0226, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to arrange all its MDI - /// child windows in a cascade format. - /// - MdiCascade = 0x0227, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to arrange all minimized MDI - /// child windows. It does not affect child windows that are not minimized. - /// - MdiIconArrange = 0x0228, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to retrieve the handle - /// to the active MDI child window. - /// - MdiGetActive = 0x0229, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to replace the entire menu - /// of an MDI frame window, to replace the window menu of the frame window, or both. - /// - MdiSetMenu = 0x0230, - - /// - /// Sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or - /// sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes - /// the message to the - /// - /// function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. - /// The operation is complete when - /// - /// returns. - /// - EnterSizeMove = 0x0231, - - /// - /// Sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the - /// moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the - /// window passes the message to the - /// - /// function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. - /// The operation is complete when - /// - /// returns. - /// - ExitSizeMove = 0x0232, - - /// - /// Sent when the user drops a file on the window of an application that - /// has registered itself as a recipient of dropped files. - /// - DropFiles = 0x0233, - - /// - /// Sent to a multiple-document interface (MDI) client window by an application to refresh - /// the window menu of the MDI frame window. - /// - MdiRefreshMenu = 0x0234, - - /// - /// Sent to a window when there is a change in the settings of a monitor that has a digitizer attached to it. - /// This message contains information regarding the scaling of the display mode. - /// Only supported on Windows 7 and higher. - /// - PointerDeviceChange = 0x0238, - - /// - /// Sent to a window when a pointer device is detected within range of an input digitizer. - /// This message contains information regarding the device and its proximity. - /// Only supported on Windows 7 and higher. - /// - PointerDeviceInRange = 0x0239, - - /// - /// Sent to a window when a pointer device has departed the range of an input digitizer. - /// This message contains information regarding the device and its proximity. - /// Only supported on Windows 7 and higher. - /// - PointerDeviceOutOfRange = 0x023A, - - /// - /// Notifies the window when one or more touch points, such as a finger or pen, - /// touches a touch-sensitive digitizer surface. - /// Only supported on Windows 7 and higher. - /// - Touch = 0x0240, - - /// - /// Posted to provide an update on a pointer that made contact over the non-client area of a window or when a - /// hovering uncaptured contact moves over the non-client area of a window. While the pointer is hovering, - /// the message targets whichever window the pointer happens to be over. While the pointer is in contact with - /// the surface, the pointer is implicitly captured to the window over which the pointer made contact and that - /// window continues to receive input for the pointer until it breaks contact. - /// Only supported on Windows 8 and higher. - /// - NCPointerUpdate = 0x0241, - - /// - /// Posted when a pointer makes contact over the non-client area of a window. The message targets the window - /// over which the pointer makes contact. The pointer is implicitly captured to the window so that the window - /// continues to receive input for the pointer until it breaks contact. - /// Only supported on Windows 8 and higher. - /// - NCPointerDown = 0x0242, - - /// - /// Posted when a pointer that made contact over the non-client area of a window breaks contact. The message - /// targets the window over which the pointer makes contact and the pointer is, at that point, implicitly - /// captured to the window so that the window continues to receive input for the pointer until it breaks - /// contact, including the notification. - /// If a window has captured this pointer, this message is not posted. Instead, a - /// is posted to the window that has captured this pointer. - /// Only supported on Windows 8 and higher. - /// - NCPointerUp = 0x0243, - - /// - /// Posted to provide an update on a pointer that made contact over the client area of a window or on a - /// hovering uncaptured pointer over the client area of a window. While the pointer is hovering, the message - /// targets whichever window the pointer happens to be over. While the pointer is in contact with the surface, - /// the pointer is implicitly captured to the window over which the pointer made contact and that window - /// continues to receive input for the pointer until it breaks contact. - /// Only supported on Windows 8 and higher. - /// - PointerUpdate = 0x0245, - - /// - /// Posted when a pointer makes contact over the client area of a window. This input message targets the - /// window over which the pointer makes contact, and the pointer is implicitly captured to the window so - /// that the window continues to receive input for the pointer until it breaks contact. - /// Only supported on Windows 8 and higher. - /// - PointerDown = 0x0246, - - /// - /// Posted when a pointer that made contact over the client area of a window breaks contact. This input - /// message targets the window over which the pointer makes contact and the pointer is, at that point, - /// implicitly captured to the window so that the window continues to receive input messages including - /// the notification for the pointer until it breaks contact. - /// Only supported on Windows 8 and higher. - /// - PointerUp = 0x0247, - - /// - /// Sent to a window when a new pointer enters detection range over the window (hover) or when an - /// existing pointer moves within the boundaries of the window. - /// Only supported on Windows 8 and higher. - /// - PointerEnter = 0x0249, - - /// - /// Sent to a window when a pointer leaves detection range over the window (hover) or when a - /// pointer moves outside the boundaries of the window. - /// Only supported on Windows 8 and higher. - /// - PointerLeave = 0x024A, - - /// - /// Sent to an inactive window when a primary pointer generates a over the window. - /// As long as the message remains unhandled, it travels up the parent window chain until it is reaches the - /// top-level window. Applications can respond to this message to specify whether they wish to be activated. - /// - /// Only supported on Windows 8 and higher. - /// - PointerActivate = 0x024B, - - /// - /// Sent to a window that is losing capture of an input pointer. - /// Only supported on Windows 8 and higher. - /// - PointerCaptureChanged = 0x024C, - - /// - /// Sent to a window on a touch down in order to determine the most probable touch target. - /// Only supported on Windows 8 and higher. - /// - TouchHitTesting = 0x024D, - - /// - /// Posted to the window with foreground keyboard focus when a scroll wheel is rotated. - /// Only supported on Windows 8 and higher. - /// - PointerWheel = 0x024E, - - /// - /// Posted to the window with foreground keyboard focus when a horizontal scroll wheel is rotated. - /// Only supported on Windows 8 and higher. - /// - PointerHWheel = 0x024F, - - /// - /// This member is not officially documented. Use with care. - /// Only supported on Windows 8 and higher. - /// - PointerHitTest = 0x0250, - - /// - /// Sent when ongoing pointer input, for an existing pointer ID, transitions from one process to another - /// across content configured for cross-process chaining (AddContentWithCrossProcessChaining). - /// Only supported on Windows 8 and higher. - /// - PointerRoutedTo = 0x0251, - - /// - /// Sent when pointer input transitions from one process to another across content configured for - /// cross-process chaining (AddContentWithCrossProcessChaining). - /// Only supported on Windows 8 and higher. - /// - PointerRoutedAway = 0x0252, - - /// - /// Sent to all processes (configured for cross-process chaining through AddContentWithCrossProcessChaining - /// and not currently handling pointer input) ever associated with a specific pointer ID, - /// when a message is received on the current process. - /// Only supported on Windows 8 and higher. - /// - PointerRoutedReleased = 0x0253, - - /// - /// Sent to an application when a window is activated. - /// - ImeSetContext = 0x0281, - - /// - /// Sent to an application to notify it of changes to the IME window. - /// - ImeNotify = 0x0282, - - /// - /// Sent by an application to direct the IME window to carry out the requested command. The application - /// uses this message to control the IME window that it has created. - /// - ImeControl = 0x0283, - - /// - /// Sent to an application when the IME window finds no space to extend the area for the composition window. - /// - ImeCompositionFull = 0x0284, - - /// - /// Sent to an application when the operating system is about to change the current IME. - /// - ImeSelect = 0x0285, - - /// - /// Sent to an application when the IME gets a character of the conversion result. - /// - ImeChar = 0x0286, - - /// - /// Sent to an application to provide commands and request information. - /// - ImeRequest = 0x0288, - - /// - /// Sent to an application by the IME to notify the application of a key press and to keep message order. - /// - ImeKeydown = 0x0290, - - /// - /// Sent to an application by the IME to notify the application of a key release and to keep message order. - /// - ImeKeyup = 0x0291, - - /// - /// Posted to a window when the cursor hovers over the nonclient area of the window for the period of time - /// specified in a prior call to . - /// - NCMouseHover = 0x02A0, - - /// - /// Posted to a window when the cursor hovers over the client area of the window for the period of time - /// specified in a prior call to . - /// - MouseHover = 0x02A1, - - /// - /// Posted to a window when the cursor leaves the nonclient area of the window specified - /// in a prior call to . - /// - NCMouseLeave = 0x02A2, - - /// - /// Posted to a window when the cursor leaves the client area of the window specified - /// in a prior call to . - /// - MouseLeave = 0x02A3, - - /// - /// Notifies applications of changes in session state. - /// - WtsSessionChange = 0x02B1, - - /// - /// This member is not officially documented. Use with care. - /// - TabletFirst = 0x02C0, - - /// - /// This member is not officially documented. Use with care. - /// - TabletLast = 0x02DF, - - /// - /// Sent when the effective dots per inch (dpi) for a window has changed. The DPI is the scale factor for a - /// window. There are multiple events that can cause the DPI to change. - /// Only supported on Windows 7 and higher. - /// - DpiChanged = 0x02E0, - - /// - /// For Per Monitor v2 top-level windows, this message is sent to all HWNDs in the child HWDN tree of the - /// window that is undergoing a DPI change. This message occurs before the top-level window receives - /// , and traverses the child tree from the bottom up. - /// Only supported on Windows 10. - /// - DpiChangedBeforeParent = 0x02E2, - - /// - /// For Per Monitor v2 top-level windows, this message is sent to all HWNDs in the child HWDN tree of the - /// window that is undergoing a DPI change. This message occurs after the top-level window receives - /// , and traverses the child tree from the top down. - /// Only supported on Windows 10. - /// - DpiChangedAfterParent = 0x02E3, - - /// - /// This message tells the operating system that the window will be sized to dimensions other than the default. - /// - /// Only supported on Windows 10. - /// - GetDpiScaledSize = 0x02E4, - - /// - /// Sent to an edit control or combo box by an application to delete (cut) the current selection, - /// if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. - /// - Cut = 0x0300, - - /// - /// Sent to an edit control or combo box by an application to copy the current selection - /// to the clipboard in CF_TEXT format. - /// - Copy = 0x0301, - - /// - /// Sent to an edit control or combo box by an application to copy the current content of the clipboard to the - /// edit control at the current caret position. - /// Data is inserted only if the clipboard contains data in CF_TEXT format. - /// - Paste = 0x0302, - - /// - /// Sent to an edit control or combo box by an application to delete (clear) the current selection, - /// if any, from the edit control. - /// - Clear = 0x0303, - - /// - /// Sent to an edit control by an application to undo the last operation. When this message is sent to - /// an edit control, the previously deleted text is restored or the previously added text is deleted. - /// - Undo = 0x0304, - - /// - /// Sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application - /// has requested data in that format. The clipboard owner must render data in the specified format - /// and place it on the clipboard by calling the SetClipboardData function. - /// - RenderFormat = 0x0305, - - /// - /// Sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or - /// more clipboard formats. For the content of the clipboard to remain available to other applications, - /// the clipboard owner must render data in all the formats it is capable of generating, and place the - /// data on the clipboard by calling the SetClipboardData function. - /// - RenderAllFormats = 0x0306, - - /// - /// Sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. - /// - DestroyClipboard = 0x0307, - - /// - /// Sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This - /// enables a clipboard viewer window to display the new content of the clipboard. - /// - DrawClipboard = 0x0308, - - /// - /// Sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the - /// CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. - /// - PaintClipboard = 0x0309, - - /// - /// Sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the - /// CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. - /// The owner should scroll the clipboard image and update the scroll bar values. - /// - VScrollClipboard = 0x030A, - - /// - /// Sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the - /// CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. - /// - SizeClipboard = 0x030B, - - /// - /// Sent to the clipboard owner by a clipboard viewer window to request the name of a - /// CF_OWNERDISPLAY clipboard format. - /// - AskClipboardFormatName = 0x030C, - - /// - /// Sent to the first window in the clipboard viewer chain when a window is being removed from the chain. - /// - ChangeClipboardChain = 0x030D, - - /// - /// Sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in - /// the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner - /// should scroll the clipboard image and update the scroll bar values. - /// - HScrollClipboard = 0x030E, - - /// - /// Informs a window that it is about to receive the keyboard focus, giving the window the opportunity - /// to realize its logical palette when it receives the focus. - /// - QueryNewPalette = 0x030F, - - /// - /// Informs applications that an application is going to realize its logical palette. - /// - PaletteIsChanging = 0x0310, - - /// - /// Sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes - /// its logical palette. This message enables windows that do not have the keyboard focus to realize - /// their logical palettes and update their client areas. - /// - PaletteChanged = 0x0311, - - /// - /// Posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed - /// at the top of the message queue associated with the thread that registered the hot key. - /// - Hotkey = 0x0312, - - /// - /// Sent to a window to request that it draw itself in the specified device context, - /// most commonly in a printer device context. - /// - Print = 0x0317, - - /// - /// Sent to a window to request that it draw its client area in the specified device context, - /// most commonly in a printer device context. - /// - PrintClient = 0x0318, - - /// - /// Notifies a window that the user generated an application command event, for example, by clicking an - /// application command button using the mouse or typing an application command key on the keyboard. - /// - AppCommand = 0x0319, - - /// - /// Broadcast to every window following a theme change event. Examples of theme change events are the - /// activation of a theme, the deactivation of a theme, or a transition from one theme to another. - /// - ThemeChanged = 0x031A, - - /// - /// Sent when the contents of the clipboard have changed. - /// - ClipboardUpdate = 0x031D, - - /// - /// Informs all top-level windows that Desktop Window Manager (DWM) composition has been enabled or disabled. - /// - /// Only supported on Windows Vista or higher. - /// - DwmCompositionChanged = 0x031E, - - /// - /// Sent when the non-client area rendering policy has changed. - /// Only supported on Windows Vista or higher. - /// - DwmNCRenderingChanged = 0x031F, - - /// - /// Informs all top-level windows that the colorization color has changed. - /// Only supported on Windows Vista or higher. - /// - DwmColorizationColorChanged = 0x0320, - - /// - /// Sent when a Desktop Window Manager (DWM) composed window is maximized. - /// Only supported on Windows Vista or higher. - /// - DwmWindowMaximizedChange = 0x0321, - - /// - /// Instructs a window to provide a static bitmap to use as a thumbnail representation of that window. - /// Only supported on Windows 7 or higher. - /// - DwmSendIconicThumbnail = 0x0323, - - /// - /// Instructs a window to provide a static bitmap to use as a - /// live preview (also known as a Peek preview) of that window. - /// Only supported on Windows 7 or higher. - /// - DwmSendIconicLivePreviewBitmap = 0x0326, - - /// - /// Sent to request extended title bar information. - /// Only supported on Windows Vista or higher. - /// - GetTitleBarInfoEx = 0x033F, - - /// - /// This member is not officially documented. Use with care. - /// - HandheldFirst = 0x0358, - - /// - /// This member is not officially documented. Use with care. - /// - HandheldLast = 0x035F, - - /// - /// Specifies the first afx message. - /// - AfxFirst = 0x0360, - - /// - /// Specifies the last afx message. - /// - AfxLast = 0x037F, - - /// - /// This member is not officially documented. Use with care. - /// - PenWinFirst = 0x0380, - - /// - /// This member is not officially documented. Use with care. - /// - PenWinLast = 0x038F, - - /// - /// Used by applications to help define private messages, - /// usually of the form + X, where X is an integer value. - /// - App = 0x8000, - - /// - /// Used by applications to help define private messages for use by private window classes, - /// usually of the form + X, where X is an integer value. - /// - User = 0x0400, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs b/Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs deleted file mode 100644 index 5085e507..00000000 --- a/Crow/src/backends/win32/User32/Enums/WindowMessageSizeType.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// The type of resizing requested by a . - /// - public enum WindowMessageSizeType - { - /// - /// The window has been resized, but neither the - /// nor value applies. - /// - Restored = 0, - - /// - /// The window has been minimized. - /// - Minimized = 1, - - /// - /// The window has been maximized. - /// - Maximized = 2, - - /// - /// Message is sent to all pop-up windows when some other window has been restored to its former size. - /// - MaxShow = 3, - - /// - /// Message is sent to all pop-up windows when some other window is maximized. - /// - MaxHide = 4, - } -} diff --git a/Crow/src/backends/win32/User32/Enums/WindowStyles.cs b/Crow/src/backends/win32/User32/Enums/WindowStyles.cs deleted file mode 100644 index 501e9dee..00000000 --- a/Crow/src/backends/win32/User32/Enums/WindowStyles.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Every window has one or more window styles. A window style is a named constant that defines an aspect of the - /// window's appearance and behavior that is not specified by the window's class. An application usually sets - /// window styles when creating windows. It can also set the styles after creating a window by using the - /// function. - /// - [Flags] - public enum WindowStyles : uint - { - /// - /// The window is an overlapped window. An overlapped window has a title bar and a border. - /// Same as the style. - /// - Overlapped = 0x00000000, - - /// - /// The window is an overlapped window. An overlapped window has a title bar and a border. - /// Same as the style. - /// - Tiled = Overlapped, - - /// - /// The window is a control that can receive the keyboard focus when the user presses the TAB key. Pressing - /// the TAB key changes the keyboard focus to the next control with the style. - /// You can turn this style on and off to change dialog box navigation. To change this style after a window - /// has been created, use the - /// function. For user-created windows and modeless dialogs to work with tab stops, - /// alter the message loop to call the IsDialogMessage function. - /// - TabStop = 0x00010000, - - /// - /// The window has a maximize button. Cannot be combined with the - /// style. The - /// style must also be specified. - /// - MaximizeBox = 0x00010000, - - /// - /// The window is the first control of a group of controls. The group consists of this first control and all - /// controls defined after it, up to the next control with the style. The first control - /// in each group usually has the style so that the user can move from group to group. - /// The user can subsequently change the keyboard focus from one control in the group to - /// the next control in the group by using the direction keys. - /// You can turn this style on and off to change dialog box navigation. To change this style after a window - /// has been created, use the - /// function. - /// - Group = 0x00020000, - - /// - /// The window has a minimize button. Cannot be combined with the - /// style. - /// The style must also be specified. - /// - MinimizeBox = 0x00020000, - - /// - /// The window has a sizing border. Same as the style. - /// - ThickFrame = 0x00040000, - - /// - /// The window has a sizing border. Same as the style. - /// - SizeBox = ThickFrame, - - /// - /// The window has a window menu on its title bar. The style must also be specified. - /// - SystemMenu = 0x00080000, - - /// - /// The window has a horizontal scroll bar. - /// - HScroll = 0x00100000, - - /// - /// The window has a vertical scroll bar. - /// - VScroll = 0x00200000, - - /// - /// The window has a border of a style typically used with dialog boxes. - /// A window with this style cannot have a title bar. - /// - DialogFrame = 0x00400000, - - /// - /// The window has a thin-line border. - /// - Border = 0x00800000, - - /// - /// The window has a title bar (includes the style). - /// - Caption = Border | DialogFrame, - - /// - /// The window is initially maximized. - /// - Maximize = 0x01000000, - - /// - /// Excludes the area occupied by child windows when drawing occurs within the parent window. - /// This style is used when creating the parent window. - /// - ClipChildren = 0x02000000, - - /// - /// Clips child windows relative to each other; that is, when a particular child window receives a - /// message, the style clips all other overlapping - /// child windows out of the region of the child window to be updated. If is not - /// specified and child windows overlap, it is possible, when drawing within the client area of a child window, - /// to draw within the client area of a neighboring child window. - /// - ClipSiblings = 0x04000000, - - /// - /// The window is initially disabled. A disabled window cannot receive input from the user. To change this - /// after a window has been created, use the EnableWindow function. - /// - Disabled = 0x08000000, - - /// - /// The window is initially visible. - /// This style can be turned on and off by using the - /// or function. - /// - Visible = 0x10000000, - - /// - /// The window is initially minimized. Same as the style. - /// - Minimize = 0x20000000, - - /// - /// The window is initially minimized. Same as the style. - /// - Iconic = Minimize, - - /// - /// The window is a child window. A window with this style cannot have a menu bar. - /// This style cannot be used with the style. - /// - Child = 0x40000000, - - /// - /// Same as the style. - /// - ChildWindow = Child, - - /// - /// The windows is a pop-up window. This style cannot be used with the style. - /// - Popup = 0x80000000, - - /// - /// The window is an overlapped window. Same as the style. - /// - OverlappedWindow = Overlapped | Caption | SystemMenu | ThickFrame | MinimizeBox | MaximizeBox, - - /// - /// The window is an overlapped window. Same as the style. - /// - TiledWindow = OverlappedWindow, - - /// - /// The window is a pop-up window. The and - /// styles must be combined to make the window menu visible. - /// - PopupWindow = Popup | Border | SystemMenu, - } -} diff --git a/Crow/src/backends/win32/User32/Icon.cs b/Crow/src/backends/win32/User32/Icon.cs deleted file mode 100644 index 468aabe7..00000000 --- a/Crow/src/backends/win32/User32/Icon.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with icons. - /// - public static class Icon - { - /// - /// Creates an icon or cursor from an structure. - /// - /// - /// An structure the function uses to create the icon or cursor. - /// - /// - /// If the function succeeds, the return value is a handle to the icon or cursor that is created. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - public static extern IntPtr CreateIconIndirect([In] ref IconInfo iconInfo); - - /// - /// Destroys an icon and frees any memory the icon occupied. - /// - /// A handle to the icon to be destroyed. The icon must not be in use. - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool DestroyIcon([In] IntPtr icon); - - /// - /// Retrieves information about the specified icon or cursor. - /// - /// A handle to the icon or cursor. - /// - /// A pointer to an structure. The function fills in the structure's members. - /// - /// - /// If the function succeeds, the return value is true and the function - /// fills in the members of the specified structure. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetIconInfo([In] IntPtr icon, [Out] out IconInfo iconInfo); - - /// - /// Retrieves information about the specified pre-defined cursor. - /// - /// One of the pre-defined cursors. - /// - /// A pointer to an structure. The function fills in the structure's members. - /// - /// - /// If the function succeeds, the return value is true and the function - /// fills in the members of the specified structure. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - public static bool GetIconInfo(CursorName cursorName, out IconInfo iconInfo) - { - return GetIconInfo(new IntPtr((int)cursorName), out iconInfo); - } - - /// - /// Retrieves information about the specified pre-defined icon. - /// - /// One of the pre-defined cursors. - /// - /// A pointer to an structure. The function fills in the structure's members. - /// - /// - /// If the function succeeds, the return value is true and the function - /// fills in the members of the specified structure. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - public static bool GetIconInfo(IconName iconName, out IconInfo iconInfo) - { - return GetIconInfo(new IntPtr((int)iconName), out iconInfo); - } - - /// - /// Loads the specified icon resource from the executable (.exe) - /// file associated with an application instance. - /// - /// - /// A handle to an instance of the module whose executable file contains the icon to be loaded. - /// This parameter must be when a standard icon is being loaded. - /// - /// The name of the icon resource to be loaded. - /// - /// If the function succeeds, the return value is a handle to the newly loaded icon. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - public static extern IntPtr LoadIcon([In] [Optional] IntPtr moduleInstance, [In] string iconName); - - /// - /// Loads the specified icon resource from the executable (.exe) - /// file associated with an application instance. - /// - /// - /// A handle to an instance of the module whose executable file contains the icon to be loaded. - /// This parameter must be when a standard icon is being loaded. - /// - /// A pointer to a string with the name of the icon resource to be loaded. - /// - /// If the function succeeds, the return value is a handle to the newly loaded icon. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - public static extern IntPtr LoadIcon([In] [Optional] IntPtr moduleInstance, [In] IntPtr iconName); - - /// - /// Loads the specified icon resource from the executable (.exe) - /// file associated with an application instance. - /// - /// One of the pre-defined cursors to be loaded. - /// - /// If the function succeeds, the return value is a handle to the newly loaded icon. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - public static IntPtr LoadIcon(CursorName cursorName) - { - return LoadIcon(IntPtr.Zero, new IntPtr((int)cursorName)); - } - - /// - /// Loads the specified icon resource from the executable (.exe) - /// file associated with an application instance. - /// - /// One of the pre-defined icons to be loaded. - /// - /// If the function succeeds, the return value is a handle to the newly loaded icon. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - public static IntPtr LoadIcon(IconName iconName) - { - return LoadIcon(IntPtr.Zero, new IntPtr((int)iconName)); - } - } - } -} diff --git a/Crow/src/backends/win32/User32/Keyboard.cs b/Crow/src/backends/win32/User32/Keyboard.cs deleted file mode 100644 index 5c86e436..00000000 --- a/Crow/src/backends/win32/User32/Keyboard.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Security; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with the keyboard. - /// - public static class Keyboard - { - /// - /// Retrieves the status of the specified virtual key. The status specifies whether the key is up, down, - /// or toggled (on, off—alternating each time the key is pressed). - /// - /// The desired virtual key. - /// - /// The return value specifies the status of the specified virtual key, as follows: - /// If the high-order bit is 1, the key is down; otherwise, it is up. - /// If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is - /// turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light - /// (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern short GetKeyState([In] VirtualKey key); - - /// - /// Determines whether a key is up or down at the time the function is called, - /// and whether the key was pressed after a previous call to GetAsyncKeyState. - /// - /// The desired virtual key. - /// - /// If the function succeeds, the return value specifies whether the key was pressed since the last call - /// to , and whether the key is currently up or down. If the - /// most significant bit is set, the key is down, and if the least significant bit is set, the key was - /// pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last - /// behavior; for more information, see the Remarks section in the official documentation. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern short GetAsyncKeyState([In] VirtualKey key); - - /// - /// Retrieves the handle to the window that has the keyboard focus, - /// if the window is attached to the calling thread's message queue. - /// - /// - /// The return value is the handle to the window with the keyboard focus. If the calling thread's message - /// queue does not have an associated window with the keyboard focus, - /// the return value is . - /// - [DllImport(Library)] - public static extern IntPtr GetFocus(); - - /// - /// Sets the keyboard focus to the specified window. - /// The window must be attached to the calling thread's message queue. - /// - /// A handle to the window that will receive the keyboard input. - /// If this parameter is , keystrokes are ignored. - /// - /// If the function succeeds, the return value is the handle to the window that previously had the - /// keyboard focus. If the parameter is invalid or the window is not attached - /// to the calling thread's message queue, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - public static extern IntPtr SetFocus([In] [Optional] IntPtr window); - - /// - /// Translates (maps) a virtual-key code into a scan code or character value, - /// or translates a scan code into a virtual-key code. - /// - /// - /// The virtual key code or scan code for a key. - /// How this value is interpreted depends on the value of the parameter. - /// - /// The translation to be performed. - /// - /// The return value is either a scan code, a virtual-key code, or a character value, depending on - /// the value of and . - /// If there is no translation, the return value is zero. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern uint MapVirtualKey([In] VirtualKey vkey, [In] MapVirtualKeyType mapType); - } - } -} diff --git a/Crow/src/backends/win32/User32/Message.cs b/Crow/src/backends/win32/User32/Message.cs deleted file mode 100644 index eac8d7be..00000000 --- a/Crow/src/backends/win32/User32/Message.cs +++ /dev/null @@ -1,307 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Security; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with messages. - /// - public static class Message - { - /// - /// A special constant value that can be used to send a message to all top-level windows, including - /// disabled or invisible unowned windows, overlapped windows, and pop-up windows; - /// but not to child windows. - /// - public static readonly IntPtr BroadcastHandle = new IntPtr(0xFFFF); - - /// - /// Dispatches incoming sent messages, checks the thread message queue for a posted message, - /// and retrieves the message (if any exist). - /// - /// A structure that receives message information. - /// - /// A handle to the window whose messages are to be retrieved. - /// The window must belong to the current thread. - /// If is , - /// retrieves messages for any - /// window that belongs to the current thread, and any messages on the current thread's message queue whose - /// value is (see the structure). - /// Therefore if is , both window messages - /// and thread messages are processed. - /// If is -1, - /// retrieves only messages on the - /// current thread's message queue whose value is , - /// that is, thread messages as posted by - /// (when the window parameter is ) or PostThreadMessage. - /// - /// - /// The value of the first message in the range of messages to be examined. - /// Use to specify the first keyboard message or - /// to specify the first mouse message. - /// If and are both zero, - /// returns all available messages - /// (that is, no range filtering is performed). - /// - /// - /// The value of the last message in the range of messages to be examined. Use - /// to specify the last keyboard message or - /// to specify the last mouse message. - /// If and are both zero, - /// returns all available messages - /// (that is, no range filtering is performed). - /// - /// Specifies how messages are to be handled. - /// - /// If a message is available, the return value is true. - /// If no messages are available, the return value is false. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool PeekMessage - ( - [Out] out Msg msg, - [In] [Optional] IntPtr window, - [In] uint messageFilterMin, - [In] uint messageFilterMax, - [In] PeekMessageActions messageActions - ); - - /// - /// Retrieves a message from the calling thread's message queue. The function dispatches - /// incoming sent messages until a posted message is available for retrieval. - /// Unlike , the - /// function does not wait - /// for a message to be posted before returning. - /// - /// - /// An structure that receives message information from the thread's message queue. - /// - /// - /// A handle to the window whose messages are to be retrieved. - /// The window must belong to the current thread. - /// If is , - /// retrieves messages for any - /// window that belongs to the current thread, and any messages on the current thread's message queue whose - /// value is (see the structure). - /// Therefore if is , both window messages - /// and thread messages are processed. - /// If is -1, - /// retrieves only messages on the - /// current thread's message queue whose value is , - /// that is, thread messages as posted by - /// (when the window parameter is ) or PostThreadMessage. - /// - /// - /// The value of the first message in the range of messages to be examined. - /// Use to specify the first keyboard message or - /// to specify the first mouse message. - /// Use here and in to specify only - /// the messages. - /// If and are both zero, - /// returns all available messages - /// (that is, no range filtering is performed). - /// - /// - /// The value of the last message in the range of messages to be examined. Use - /// to specify the last keyboard message or - /// to specify the last mouse message. - /// Use here and in to specify only - /// the messages. - /// If and are both zero, - /// returns all available messages - /// (that is, no range filtering is performed). - /// - /// - /// If the function retrieves a message other than , - /// the return value is true. - /// If the function retrieves the message, the return value is false. - /// - /// If there is an error, the return value is -1. For example, the function fails if - /// is an invalid window handle or is an invalid pointer. - /// To get extended error information, call . - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern int GetMessage - ( - [Out] out Msg msg, - [In] [Optional] IntPtr window, - [In] uint messageFilterMin, - [In] uint messageFilterMax - ); - - /// - /// Retrieves the message time for the last message retrieved by the - /// function. The time is a long integer that - /// specifies the elapsed time, in milliseconds, from the time the system was started to the time the - /// message was created (that is, placed in the thread's message queue). - /// - /// The return value specifies the message time. - [DllImport(Library)] - public static extern int GetMessageTime(); - - /// - /// Sends the specified message to a window or windows. The - /// function calls the window procedure for the - /// specified window and does not return until the window procedure has processed the message. - /// - /// - /// A handle to the window whose window procedure will receive the message. - /// Message sending is subject to UIPI. The thread of a process can send messages only to message queues - /// of threads in processes of lesser or equal integrity level. - /// - /// The message to be sent. - /// Additional message-specific information. - /// Additional message-specific information. - /// - /// The return value specifies the result of the message processing; it depends on the message sent. - /// - [DllImport(Library, SetLastError = true)] - public static extern IntPtr SendMessage - ( - [In] IntPtr window, - [In] WindowMessage msg, - [In] IntPtr wparam, - [In] IntPtr lparam - ); - - /// - /// Sends a message to all top-level windows in the system, including disabled or invisible unowned - /// windows, overlapped windows, and pop-up windows; but not to child windows. - /// - /// The message to be sent. - /// Additional message-specific information. - /// Additional message-specific information. - /// - /// The return value specifies the result of the message processing; it depends on the message sent. - /// - /// - /// This method uses the constant for this special behavior. - /// - public static IntPtr SendMessageAsBroadcast(WindowMessage msg, IntPtr wparam, IntPtr lparam) - { - return SendMessage(BroadcastHandle, msg, wparam, lparam); - } - - /// - /// Places (posts) a message in the message queue associated with the thread that created the specified - /// window and returns without waiting for the thread to process the message. - /// - /// - /// A handle to the window whose window procedure is to receive the message. - /// Starting with Windows Vista, message posting is subject to UIPI. The thread of a process can post - /// messages only to message queues of threads in processes of lesser or equal integrity level. - /// If is , this function will behave like a call to - /// PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread. - /// - /// The message to be posted. - /// Additional message-specific information. - /// Additional message-specific information. - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool PostMessage - ( - [In] [Optional] IntPtr window, - [In] WindowMessage msg, - [In] IntPtr wparam, - [In] IntPtr lparam - ); - - /// - /// Places (posts) a message to all top-level windows in the system, including disabled or invisible - /// unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows. - /// - /// The message to be posted. - /// Additional message-specific information. - /// Additional message-specific information. - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - /// - /// This method uses the constant for this special behavior. - /// - public static bool PostMessageAsBroadcast(WindowMessage msg, IntPtr wparam, IntPtr lparam) - { - return PostMessage(BroadcastHandle, msg, wparam, lparam); - } - - /// - /// Indicates to the system that a thread has made a request to terminate (quit). - /// It is typically used in response to a message. - /// - /// - /// The application exit code. This value is used as the - /// wParam parameter of the message. - /// - [DllImport(Library)] - public static extern void PostQuitMessage([In] int exitCode); - - /// - /// Dispatches a message to a window procedure. It is typically used to - /// dispatch a message retrieved by the function. - /// - /// A structure that contains the message. - /// - /// The return value specifies the value returned by the window procedure. - /// Although its meaning depends on the message being dispatched, the return value generally is ignored. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library)] - public static extern IntPtr DispatchMessage([In] ref Msg msg); - - /// - /// Translates virtual-key messages into character messages. The character messages are posted to the - /// calling thread's message queue, to be read the next time the thread calls the - /// or - /// function. - /// - /// - /// An structure that contains message information retrieved from the - /// calling thread's message queue by using the or - /// function. - /// - /// - /// If the message is translated (that is, a character message is posted to the thread's message queue), - /// the return value is true. - /// If the message is , , - /// , or , - /// the return value is true, regardless of the translation. - /// If the message is not translated (that is, a character message is not posted to the - /// thread's message queue), the return value is false. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool TranslateMessage([In] ref Msg msg); - - /// - /// Retrieves the type of messages found in the calling thread's message queue. - /// - /// The types of messages for which to check. - /// - /// The high-order word of the return value indicates the types of messages currently in the queue. - /// The low-order word indicates the types of messages that have been added to the queue and that are - /// still in the queue since the last call to the , - /// , or - /// function. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library)] - public static extern uint GetQueueStatus([In] QueueMessageTypes flags); - } - } -} diff --git a/Crow/src/backends/win32/User32/Monitor.cs b/Crow/src/backends/win32/User32/Monitor.cs deleted file mode 100644 index d7cc6cce..00000000 --- a/Crow/src/backends/win32/User32/Monitor.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with monitors. - /// - public static class Monitor - { - /// - /// Retrieves information about a display monitor. - /// - /// A handle to the display monitor of interest. - /// - /// A pointer to a or MONITORINFOEX structure - /// that receives information about the specified display monitor. - /// You must set the Size member of the structure to the respective structure's size in bytes - /// before calling the function. Doing so - /// lets the function determine the type of structure you are passing to it. - /// - /// - /// If the function succeeds, the return value is nonzero. - /// If the function fails, the return value is zero. - /// - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetMonitorInfo([In] IntPtr monitor, [Out] out MonitorInfo monitorInfo); - - /// - /// Retrieves a handle to the display monitor that contains a specified point. - /// - /// - /// A structure that specifies the point of interest in virtual-screen coordinates. - /// - /// - /// Determines the function's return value if the point is not contained within any display monitor. - /// - /// - /// If the point is contained by a display monitor, - /// the return value is an handle to that display monitor. - /// If the point is not contained by a display monitor, - /// the return value depends on the value of . - /// - [DllImport(Library)] - public static extern IntPtr MonitorFromPoint([In] Point pt, [In] MonitorFromDefaultValue defaultTo); - - /// - /// Retrieves a handle to the display monitor that has the largest area of intersection - /// with the bounding rectangle of a specified window. - /// - /// A handle to the window of interest. - /// - /// Determines the function's return value if the window does not intersect any display monitor. - /// - /// - /// If the window intersects one or more display monitor rectangles, the return value is an - /// handle to the display monitor that - /// has the largest area of intersection with the window. - /// If the window does not intersect a display monitor, - /// the return value depends on the value of . - /// - [DllImport(Library)] - public static extern IntPtr MonitorFromWindow([In] IntPtr window, [In] MonitorFromDefaultValue defaultTo); - } - } -} diff --git a/Crow/src/backends/win32/User32/Mouse.cs b/Crow/src/backends/win32/User32/Mouse.cs deleted file mode 100644 index b61eaa2b..00000000 --- a/Crow/src/backends/win32/User32/Mouse.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with the mouse. - /// - public static class Mouse - { - /// - /// Retrieves a handle to the window (if any) that has captured the mouse. Only one window at a time can - /// capture the mouse; this window receives mouse input whether or not the cursor is within its borders. - /// - /// - /// The return value is a handle to the capture window associated with the current thread. - /// If no window in the thread has captured the mouse, the return value is . - /// - [DllImport(Library)] - public static extern IntPtr GetCapture(); - - /// - /// Sets the mouse capture to the specified window belonging to the current thread. - /// captures mouse input either when the mouse is over the capturing window, - /// or when the mouse button was pressed while the mouse was over the capturing window and the button is - /// still down. Only one window at a time can capture the mouse. - /// If the mouse cursor is over a window created by another thread, - /// the system will direct mouse input to the specified window only if a mouse button is down. - /// - /// - /// A handle to the window in the current thread that is to capture the mouse. - /// - /// - /// The return value is a handle to the window that had previously captured the mouse. - /// If there is no such window, the return value is . - /// - [DllImport(Library)] - public static extern IntPtr SetCapture(IntPtr window); - - /// - /// Releases the mouse capture from a window in the current thread and restores normal mouse input - /// processing. A window that has captured the mouse receives all mouse input, regardless of the position - /// of the cursor, except when a mouse button is clicked while the cursor - /// hot spot is in the window of another thread. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ReleaseCapture(); - - /// - /// Posts messages when the mouse pointer leaves a window or hovers - /// over a window for a specified amount of time. - /// - /// - /// A pointer to a structure that contains tracking information. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool TrackMouseEvent([In] [Out] ref TrackMouseEvent trackMouseEvent); - - /// - /// Retrieves a history of up to 64 previous coordinates of the mouse or pen. - /// - /// The size, in bytes, of the structure. - /// - /// A pointer to a structure containing valid mouse coordinates - /// (in screen coordinates). It may also contain a time stamp. - /// - /// - /// A pointer to a buffer that will receive the points. - /// It should be at least * in size. - /// - /// The number of points to be retrieved. - /// The resolution desired. - /// - /// If the function succeeds, the return value is the number of points in the buffer. - /// Otherwise, the function returns –1. - /// For extended error information, your application can call . - /// - [DllImport("user32", SetLastError = true)] - public static extern int GetMouseMovePointsEx - ( - [In] uint size, - [In] ref MouseMovePoint movePointIn, - [Out] out MouseMovePoint[] movePointOutBuffer, - [In] int pointAmount, - [In] GetMouseMovePointsResolution resolution - ); - - /// - /// Retrieves a history of up to 64 previous coordinates of the mouse or pen. - /// - /// The size, in bytes, of the structure. - /// - /// A pointer to a structure containing valid mouse coordinates - /// (in screen coordinates). It may also contain a time stamp. - /// - /// - /// A pointer to a buffer that will receive the points. - /// It should be at least * in size. - /// - /// The number of points to be retrieved. - /// The resolution desired. - /// - /// If the function succeeds, the return value is the number of points in the buffer. - /// Otherwise, the function returns –1. - /// For extended error information, your application can call . - /// - [DllImport("user32", SetLastError = true)] - public static unsafe extern int GetMouseMovePointsEx - ( - [In] uint size, - [In] ref MouseMovePoint movePointIn, - [Out] MouseMovePoint* movePointOutBuffer, - [In] int pointAmount, - [In] GetMouseMovePointsResolution resolution - ); - } - } -} diff --git a/Crow/src/backends/win32/User32/RawInput.cs b/Crow/src/backends/win32/User32/RawInput.cs deleted file mode 100644 index 48649616..00000000 --- a/Crow/src/backends/win32/User32/RawInput.cs +++ /dev/null @@ -1,423 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Security; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with raw input. - /// - public static class RawInput - { - /// - /// Calls the default raw input procedure to provide default processing for any raw input messages that - /// an application does not process. This function ensures that every message is processed. - /// is called with the same parameters - /// received by the window procedure. - /// - /// An array of structures. - /// - /// The number of - /// structures pointed to by . - /// - /// The size, in bytes, of the structure. - /// - /// If successful, the function returns . Otherwise it returns an error value. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library)] - public static extern IntPtr DefRawInputProc - ( - [In] Native.RawInput[] rawInputArrayOut, - [In] int rawInputAmount, - [In] uint headerSize - ); - - /// - /// Calls the default raw input procedure to provide default processing for any raw input messages that - /// an application does not process. This function ensures that every message is processed. - /// is called with the same parameters - /// received by the window procedure. - /// - /// - /// A pointer to an array of structures. - /// - /// - /// The number of - /// structures pointed to by . - /// - /// The size, in bytes, of the structure. - /// - /// If successful, the function returns . Otherwise it returns an error value. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library)] - public static unsafe extern IntPtr DefRawInputProc - ( - [In] Native.RawInput* rawInputArrayOut, - [In] int rawInputAmount, - [In] uint headerSize - ); - - /// - /// Registers the devices that supplies the raw input data. - /// - /// - /// An array of structures that - /// represent the devices that supply the raw input. - /// - /// - /// The number of structures pointed to by . - /// - /// The size, in bytes, of a structure. - /// - /// True if the function succeeds; otherwise, false. - /// If the function fails, call for more information. - /// - //[DllImport(Library, SetLastError = true)] - //[return: MarshalAs(UnmanagedType.Bool)] - //public static extern bool RegisterRawInputDevices - //( - // [In] RawInputDevice[] rawInputDevices, - // [In] uint deviceAmount, - // [In] uint size - //); - - /// - /// Retrieves the information about the raw input devices for the current application. - /// - /// - /// An array of structures for the application. - /// - /// - /// The number of structures in . - /// - /// The size, in bytes, of a structure. - /// - /// If successful, the function returns a non-negative number that is - /// the number of structures written to the buffer. - /// If the buffer is too small or null, the function sets the last - /// error as ERROR_INSUFFICIENT_BUFFER, returns -1, and sets to the - /// required number of devices. If the function fails for any other reason, it returns -1. - /// For more details, call . - /// - //[DllImport(Library, SetLastError = true)] - //public static extern uint GetRegisteredRawInputDevices - //( - // [Out] [Optional] RawInputDevice[] rawInputDevicesOut, - // [In] [Out] ref uint deviceAmount, - // [In] uint size - //); - - /// - /// Performs a buffered read of the raw input data. - /// - /// - /// A buffer of structures that contain the raw input data. - /// If null, the minimum required buffer, in bytes, is returned in . - /// - /// The size, in bytes, of a structure. - /// The size, in bytes, of the structure. - /// - /// If is null and the function is successful, the return value is zero. - /// If is not null and the function is successful, the return value is the - /// number of structures written to . - /// If an error occurs, the return value is -1. - /// Call for the error code. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern uint GetRawInputBuffer - ( - [Out] [Optional] Native.RawInput[] data, - [In] [Out] ref uint rawInputSize, - [In] uint headerSize - ); - - /// - /// Performs a buffered read of the raw input data. - /// - /// - /// A pointer to a buffer of structures that contain the raw input data. - /// If null, the minimum required buffer, in bytes, is returned in . - /// - /// The size, in bytes, of a structure. - /// The size, in bytes, of the structure. - /// - /// If is null and the function is successful, the return value is zero. - /// If is not null and the function is successful, the return value is the - /// number of structures written to . - /// If an error occurs, the return value is (uint)-1. - /// Call for the error code. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static unsafe extern uint GetRawInputBuffer - ( - [Out] [Optional] Native.RawInput* data, - [In] [Out] ref uint rawInputSize, - [In] uint headerSize - ); - - /// - /// Enumerates the raw input devices attached to the system. - /// - /// - /// An array of structures for the devices attached to the system. - /// If null, the number of devices are returned in . - /// - /// - /// If is null, the function populates this variable with - /// the number of devices attached to the system; otherwise, this variable specifies the number of - /// structures that can be contained in the buffer to which - /// points. If this value is less than the number of devices - /// attached to the system, the function returns the actual number of devices in this variable - /// and fails with ERROR_INSUFFICIENT_BUFFER. - /// - /// - /// The size of a structure, in bytes. - /// - /// - /// If the function is successful, the return value is the number of devices stored in the buffer - /// pointed to by . - /// On any other error, the function returns (uint)-1 and - /// returns the error indication. - /// - [DllImport(Library, SetLastError = true)] - public static extern uint GetRawInputDeviceList - ( - [Out] [Optional] RawInputDeviceList[] deviceListArrayOut, - [In] [Out] ref uint deviceListAmount, - [In] uint deviceListSize - ); - - /// - /// Enumerates the raw input devices attached to the system. - /// - /// - /// A pointer to an array of structures for the devices attached to the - /// system. If null, the number of devices are returned in . - /// - /// - /// If is null, the function populates this variable with - /// the number of devices attached to the system; otherwise, this variable specifies the number of - /// structures that can be contained in the buffer to which - /// points. If this value is less than the number of devices - /// attached to the system, the function returns the actual number of devices in this variable - /// and fails with ERROR_INSUFFICIENT_BUFFER. - /// - /// - /// The size of a structure, in bytes. - /// - /// - /// If the function is successful, the return value is the number of devices stored in the buffer - /// pointed to by . - /// On any other error, the function returns (uint)-1 and - /// returns the error indication. - /// - [DllImport(Library, SetLastError = true)] - public static unsafe extern uint GetRawInputDeviceList - ( - [Out] [Optional] RawInputDeviceList* deviceListArrayOut, - [In] [Out] ref uint deviceListAmount, - [In] uint deviceListSize - ); - - /// - /// Retrieves information about the raw input device. - /// - /// - /// A handle to the raw input device. This comes from the or - /// from . - /// - /// Specifies what data will be returned in . - /// - /// A buffer that contains the information specified by . - /// If is , set the - /// to before calling - /// . - /// - /// The size, in bytes, of the data in . - /// - /// If successful, this function returns a non-negative number indicating the number - /// of bytes copied to . - /// If pData is not large enough for the data, the function returns -1. If is - /// , the function returns a value of zero. In both of these cases, - /// is set to the minimum size required for the buffer. - /// - /// Call to identify any other errors. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern uint GetRawInputDeviceInfo - ( - [In] [Optional] IntPtr device, - [In] GetRawInputDeviceInfoEnum command, - [In] [Out] [Optional] byte[] data, - [In] [Out] ref uint dataSize - ); - - /// - /// Retrieves information about the raw input device. - /// - /// - /// A handle to the raw input device. This comes from the or - /// from . - /// - /// Specifies what data will be returned in . - /// - /// A pointer to a buffer that contains the information specified by . - /// If is , set the - /// to before calling - /// . - /// - /// The size, in bytes, of the data in . - /// - /// If successful, this function returns a non-negative number indicating the number - /// of bytes copied to . - /// If pData is not large enough for the data, the function returns -1. If is - /// , the function returns a value of zero. In both of these cases, - /// is set to the minimum size required for the buffer. - /// - /// Call to identify any other errors. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static unsafe extern uint GetRawInputDeviceInfo - ( - [In] [Optional] IntPtr device, - [In] GetRawInputDeviceInfoEnum command, - [In] [Out] [Optional] IntPtr data, - [In] [Out] ref uint dataSize - ); - - /// - /// Retrieves information about the raw input device. - /// - /// - /// A handle to the raw input device. This comes from or from - /// . - /// - /// Specifies what data will be returned in . - /// - /// A pointer to a buffer that contains the information specified by . If - /// is , set the - /// to - /// before calling this. - /// - /// The size, in bytes, of the data in . - /// - /// If successful, this function returns a non-negative number - /// indicating the number of bytes copied to . - /// If is not large enough for the data, the function returns -1. If - /// is null, the function returns a value of zero. In both of these cases, - /// is set to the minimum size required for the buffer. - /// - /// Call to identify any other errors. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern uint GetRawInputDeviceInfo - ( - [In] [Optional] IntPtr device, - [In] GetRawInputDeviceInfoEnum command, - [In] [Out] [Optional] ref RawInputDeviceInfo data, - [In] [Out] ref uint size - ); - - /// - /// Retrieves the raw input header from the specified device. - /// - /// - /// A handle to the structure. This comes from the lParam in - /// . - /// - /// The structure to receive the raw data. - /// - /// If the function is successful, the return value is the number of bytes copied into - /// . - /// If there is an error, the return value is (uint)-1 [== ]. - /// - public static unsafe uint GetRawInputData(IntPtr rawInput, out RawInputHeader header) - { - uint size = RawInputHeader.SizeInBytes; - fixed (RawInputHeader* headerPtr = &header) - { - return GetRawInputData - ( - rawInput, - GetRawInputDataCommand.Header, - (IntPtr)headerPtr, - ref size, - RawInputHeader.SizeInBytes - ); - } - } - - /// - /// Retrieves raw input data from the specified device. - /// - /// - /// A handle to the structure. This comes from the lParam in - /// . - /// - /// The structure to receive the raw data. - /// - /// If the function is successful, the return value is the number of bytes copied into - /// . - /// If there is an error, the return value is (uint)-1 [== ]. - /// - public static unsafe uint GetRawInputData(IntPtr rawInput, out Native.RawInput data) - { - uint size = Native.RawInput.SizeInBytes; - fixed (Native.RawInput* dataPtr = &data) - { - return GetRawInputData - ( - rawInput, - GetRawInputDataCommand.Input, - (IntPtr)dataPtr, - ref size, - RawInputHeader.SizeInBytes - ); - } - } - - /// - /// Retrieves the raw input from the specified device. - /// Consider using one of the other overloads for a better experience. - /// - /// - /// A handle to the structure. This comes from the lParam in - /// . - /// - /// The command flag. - /// - /// A pointer to the data that comes from the structure. This depends on the - /// value of . If is , - /// the required size of the buffer is returned in . - /// - /// The size, in bytes, of the data in . - /// The size, in bytes, of the structure. - /// - /// If is and the function is successful, the return - /// value is 0. If is not and the function is successful, - /// the return value is the number of bytes copied into . - /// If there is an error, the return value is (uint)-1 [== ]. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern uint GetRawInputData - ( - [In] IntPtr rawInput, - [In] GetRawInputDataCommand command, - [Out] [Optional] IntPtr data, - [In] [Out] ref uint size, - [In] uint headerSize - ); - } - } -} diff --git a/Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs b/Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs deleted file mode 100644 index 874402bd..00000000 --- a/Crow/src/backends/win32/User32/Structs/BroadcastDeviceInterface.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about a class of devices. - /// - public struct BroadcastDeviceInterface - { - /// - /// The size of this structure, in bytes. This is the size of the members plus the actual length of the - /// string (the null character is accounted for by the declaration of - /// as a one-character array). - /// - public uint Size; - - /// - /// Official documentation states "Set to ". - /// Only set to something else if you know what you're doing. - /// - public DeviceBroadcastType DeviceType; - - /// - /// Reserved; do not use. - /// - public uint Reserved; - - /// - /// The GUID for the interface device class. - /// - public Guid ClassGuid; - - /// - /// Gets a string that specifies the name of the device. - /// - public unsafe string Name - { - get - { - fixed (char* namePtr = &_name) - { - return Marshal.PtrToStringUni((IntPtr)namePtr); - } - } - } - - /// - /// The first character of the . - /// - private char _name; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/CreateStruct.cs b/Crow/src/backends/win32/User32/Structs/CreateStruct.cs deleted file mode 100644 index d8cb565c..00000000 --- a/Crow/src/backends/win32/User32/Structs/CreateStruct.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Defines the initialization parameters passed to the window procedure of an application. These members are - /// identical to the parameters of the - /// function. - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct CreateStruct - { - /// - /// Contains additional data which may be used to create the window. If the window is being created as a - /// result of a call to the CreateWindow or - /// - /// function, this member contains the value of the lpParam parameter specified in the function call. - /// If the window being created is a MDI client window, this member contains a pointer to a CLIENTCREATESTRUCT - /// structure. If the window being created is a MDI child window, this member contains a pointer to an - /// MDICREATESTRUCT structure. - /// If the window is being created from a dialog template, this member is the address of a - /// value that specifies the size, in bytes, of the window creation data. The value is immediately followed - /// by the creation data. - /// - public IntPtr CreateParams; - - /// - /// Handle to the module that owns the new window. - /// - public IntPtr Instance; - - /// - /// Handle to the menu to be used by the new window. - /// - public IntPtr Menu; - - /// - /// Handle to the parent window, if the window is a child window. - /// If the window is owned, this member identifies the owner window. - /// If the window is not a child or owned window, this member is null. - /// - public IntPtr Parent; - - /// - /// Specifies the height of the new window, in pixels. - /// - public int Height; - - /// - /// Specifies the width of the new window, in pixels. - /// - public int Width; - - /// - /// Specifies the y-coordinate of the upper left corner of the new window. - /// If the new window is a child window, coordinates are relative to the parent window. - /// Otherwise, the coordinates are relative to the screen origin. - /// - public int Y; - - /// - /// Specifies the x-coordinate of the upper left corner of the new window. - /// If the new window is a child window, coordinates are relative to the parent window. - /// Otherwise, the coordinates are relative to the screen origin. - /// - public int X; - - /// - /// Specifies the style for the new window. - /// - public WindowStyles Style; - - /// - /// Pointer to a null-terminated string that specifies the name of the new window. - /// - public string Name; - - /// - /// Either a pointer to a null-terminated string or an atom that specifies the class name - /// of the new window. - /// - public IntPtr ClassName; - - /// - /// The extended window style for the new window. - /// - public ExtendedWindowStyles ExtendedStyle; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/DeviceMode.cs b/Crow/src/backends/win32/User32/Structs/DeviceMode.cs deleted file mode 100644 index 9f3c13d2..00000000 --- a/Crow/src/backends/win32/User32/Structs/DeviceMode.cs +++ /dev/null @@ -1,334 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Specifies characteristics of display and print devices. - /// Before accessing a field, check the field to determine whether any given field is set. - /// - [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] - public struct DeviceMode - { - /// - /// Length of the in characters. - /// - public const int DeviceNameLength = 32; - - /// - /// Length of the in characters. - /// - public const int FormNameLength = 32; - - /// - /// Default value for and (see the documentation of those - /// fields for more information). - /// - public const ushort DefaultSpecVersion = 800; - - /// - /// A zero-terminated character array that specifies the "friendly" name of the printer or display. - /// - [FieldOffset(0)] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string DeviceName; - - /// - /// The version number of the initialization data specification on which the structure is based. - /// The current version number is identified by . - /// - [FieldOffset(64)] - public ushort SpecVersion; - - /// - /// For a printer, specifies the printer driver version number assigned by the printer driver developer. - /// Display drivers can set this member to . - /// - [FieldOffset(66)] - public ushort DriverVersion; - - /// - /// Specifies the size in bytes of the public DEVMODEW structure, not including any private, - /// driver-specified members identified by the dmDriverExtra member. - /// Set this to . - /// - [FieldOffset(68)] - public ushort Size; - - /// - /// Specifies the number of bytes of private driver data that follow the public structure members. - /// If a device driver does not provide private members, this member should be set to zero. - /// - [FieldOffset(70)] - public ushort DriverExtra; - - /// - /// Specifies bit flags identifying which of the following members are in use. - /// For example, the flag is set when the - /// member contains valid data. - /// - [FieldOffset(72)] - public DeviceModeFieldFlags Fields; - - /// - /// Provides printer-specific device mode options. - /// - [FieldOffset(76)] - public PrinterDeviceOptions PrinterOptions; - - /// - /// Provides display-specific device mode options. - /// - [FieldOffset(76)] - public DisplayDeviceOptions DisplayOptions; - - /// - /// For printers, specifies whether a color printer should print color or monochrome. - /// - [FieldOffset(92)] - public PrinterColor Color; - - /// - /// For printers, specifies duplex (double-sided) printing for duplex-capable printers. - /// - [FieldOffset(94)] - public PrinterDuplex Duplex; - - /// - /// For printers, specifies the y resolution of the printer, in DPI. If this member is used, - /// the member specifies the x resolution. - /// - [FieldOffset(96)] - public short YResolution; - - /// - /// For printers, specifies how TrueType fonts should be printed. - /// - [FieldOffset(98)] - public PrinterTrueTypeOption TrueTypeOption; - - /// - /// For printers, specifies whether multiple copies should be collated. 1 == true, 0 == false. - /// - [FieldOffset(100)] - public short Collate; - - /// - /// Gets the name of the printer form to use; such as "Letter" or "Legal". - /// This must be a name that can be obtain by calling the Win32 EnumForms function. - /// - public unsafe string FormName - { - get - { - fixed (char* formNamePtr = &_formName) - { - return Marshal.PtrToStringUni((IntPtr)formNamePtr); - } - } - } - - /// - /// With the current struct layout (which is set in stone because of interoperability with the Windows API), - /// there is no way to put a `string` type at this position(string is a reference type -> there is a pointer - /// here, which is either 4 or 8 bytes depending on the platform). This means that a string can never be - /// properly aligned at position 102 (which, again, can't be changed). This is why the - /// property exists. - /// - [FieldOffset(102)] - private char _formName; - - /// - /// For displays, specifies the number of logical pixels per inch of a display device and should be equal - /// to the ulLogPixels member of the GDIINFO structure. - /// - [FieldOffset(166)] - public ushort LogPixels; - - /// - /// For displays, specifies the color resolution, in bits per pixel, of a display device. - /// - [FieldOffset(168)] - public uint BitsPerPixel; - - /// - /// For displays, specifies the width, in pixels, of the visible device surface. - /// - [FieldOffset(172)] - public uint WidthInPixels; - - /// - /// For displays, specifies the height, in pixels, of the visible device surface. - /// - [FieldOffset(176)] - public uint HeightInPixels; - - /// - /// For displays, specifies a display device's display mode. - /// - [FieldOffset(180)] - public DisplayFlags DisplayFlags; - - /// - /// For printers, specifies whether the print system handles "N-up" printing - /// (playing multiple EMF logical pages onto a single physical page). - /// - [FieldOffset(180)] - public uint Nup; - - /// - /// For displays, specifies the frequency, in hertz, of a display device in its current mode. - /// - [FieldOffset(184)] - public uint DisplayFrequency; - - /// - /// For printers, specifies how Image Color Management (ICM) is handled. For a non-ICM application, this field - /// determines if ICM is enabled or disabled. For ICM applications, the system examines this field to determine - /// how to handle ICM support. - /// The value of this field can be one of the pre-defined values or a printer - /// driver-defined value greater than or equal to . - /// - [FieldOffset(188)] - public PrinterIcmMethod IcmMethod; - - /// - /// For printers, specifies which color matching method, or intent, is used by default. This field is primarily - /// for non-ICM applications. ICM applications can establish intents by using the ICM functions. - /// The value of this field can be one of the pre-defined values or a printer - /// driver-defined value greater than or equal to . - /// - [FieldOffset(192)] - public PrinterIcmIntent IcmIntent; - - /// - /// For printers, specifies the type of media being printed on. - /// The value of this field can be one of the pre-defined values or a printer - /// driver-defined value greater than or equal to . - /// - [FieldOffset(196)] - public PrinterMediaType MediaType; - - /// - /// Specifies how dithering is to be done. - /// The value of this field can be one of the pre-defined values or a printer - /// driver-defined value greater than or equal to . - /// - [FieldOffset(200)] - public PrinterDitherType DitherType; - - /// - /// Is reserved for system use and must be zero. - /// - [FieldOffset(204)] - public uint Reserved1; - - /// - /// Is reserved for system use and must be zero. - /// - [FieldOffset(208)] - public uint Reserved2; - - /// - /// Must be zero. - /// - [FieldOffset(212)] - public uint PanningWidth; - - /// - /// Must be zero. - /// - [FieldOffset(216)] - public uint PanningHeight; - - /// - /// The size of the structure in bytes. - /// - public static readonly ushort SizeInBytes = (ushort)Marshal.SizeOf(); - - /// - /// Contains printer-specific device options. - /// - public struct PrinterDeviceOptions - { - /// - /// For printers, specifies the paper orientation. - /// - public PrinterPaperOrientation Orientation; - - /// - /// For printers, specifies the size of the paper to be printed on. This member must be zero if the length - /// and width of the paper are specified by the and - /// members. - /// - public PrinterPaperSize PaperSize; - - /// - /// For printers, specifies the length of the paper, in units of 1/10 of a millimeter. - /// This value overrides the length of the paper specified by the member, - /// and is used if the paper is of a custom size, or if the device is a dot matrix printer, - /// which can print a page of arbitrary length. - /// - public short PaperLength; - - /// - /// For printers, specifies the width of the paper, in units of 1/10 of a millimeter. - /// This value overrides the width of the paper specified by the member. - /// This member must be used if is used. - /// - public short PaperWidth; - - /// - /// For printers, specifies the percentage by which the image is to be scaled for printing. The image's - /// page size is scaled to the physical page by a factor of /100. For example, - /// a 17-inch by 22-inch image with a scale value of 100 requires 17x22-inch paper, while the same image - /// with a scale value of 50 should print as half-sized and fit on letter-sized paper. - /// - public short Scale; - - /// - /// For printers, specifies the number of copies to be printed, if the device supports multiple copies. - /// - public short Copies; - - /// - /// For printers, specifies the printer's default input bin. If the specified constant is - /// , the input bin should be selected automatically. - /// - public PrinterDefaultSource DefaultSource; - - /// - /// For printers, specifies the printer resolution. Either set this to one of the - /// values, or use a positive value specifying the number of DPI for the - /// x resolution, with the y resolution being specified by . - /// - public PrinterPrintQuality PrintQuality; - } - - /// - /// Contains display-specific device options. - /// - public struct DisplayDeviceOptions - { - /// - /// For displays, specifies a structure containing the x- and y-coordinates of the - /// upper-left corner of the display, in desktop coordinates. This member is used to determine the - /// relative position of monitors in a multiple monitor environment. - /// - public Point Position; - - /// - /// For displays, specifies the orientation at which images should be presented. - /// - public DisplayOrientation DisplayOrientation; - - /// - /// For fixed-resolution displays, specifies how the device can present a lower-resolution mode on a - /// higher-resolution display. For example, if a display device's resolution is fixed at 1024 X 768, - /// and its mode is set to 640 x 480, the device can either display a 640 X 480 image within the 1024 X 768 - /// screen space, or stretch the 640 X 480 image to fill the larger screen space. - /// - public DisplayFixedOutputType DisplayFixedOutput; - } - } -} diff --git a/Crow/src/backends/win32/User32/Structs/DisplayDevice.cs b/Crow/src/backends/win32/User32/Structs/DisplayDevice.cs deleted file mode 100644 index db46d3d4..00000000 --- a/Crow/src/backends/win32/User32/Structs/DisplayDevice.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Receives information about the display device specified by the iDevNum parameter of the - /// function. - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct DisplayDevice - { - /// - /// Size, in bytes, of the structure. This must be initialized prior to calling - /// . - /// - /// - public uint Size; - - /// - /// An array of characters identifying the device name. - /// This is either the adapter device or the monitor device. - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string DeviceName; - - /// - /// An array of characters containing the device context string. - /// This is either a description of the display adapter or of the display monitor. - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string DeviceString; - - /// - /// Device state flags. It can be any reasonable combination of . - /// - public DisplayDeviceStateFlags StateFlags; - - /// - /// Not used. - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string DeviceID; - - /// - /// Reserved. - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string DeviceKey; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs b/Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs deleted file mode 100644 index 3bf68a38..00000000 --- a/Crow/src/backends/win32/User32/Structs/ExtendedWindowClass.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains window class information. It is used with the - /// and - /// functions. - /// The structure is similar to the structure. - /// There are two differences. includes the member, which - /// specifies the size of the structure, and the member, which contains a handle - /// to a small icon associated with the window class. - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct ExtendedWindowClass - { - /// - /// The size, in bytes, of this structure. Set this member to . - /// Be sure to set this member before calling the - /// function. - /// - public uint Size; - - /// - /// The class style(s). This member can be any combination of . - /// - public WindowClassStyles Style; - - /// - /// A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. - /// - public WindowProc WindowProc; - - /// - /// The number of extra bytes to allocate following the window-class structure. - /// The system initializes the bytes to zero. - /// - public int ClassExtra; - - /// - /// The number of extra bytes to allocate following the window instance. The system initializes the bytes - /// to zero. If an application uses to register a dialog box created by - /// using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. - /// - public int WindowExtra; - - /// - /// A handle to the instance that contains the window procedure for the class. - /// - public IntPtr Instance; - - /// - /// A handle to the class icon. This member must be a handle to an icon resource. - /// If this member is , the system provides a default icon. - /// - public IntPtr Icon; - - /// - /// A handle to the class cursor. This member must be a handle to a cursor resource. - /// If this member is , an application must explicitly set the cursor shape - /// whenever the mouse moves into the application's window. - /// - public IntPtr Cursor; - - /// - /// A handle to the class background brush. This member can be a handle to the brush to be used for - /// painting the background, or it can be a color value. - /// For more information on setting this to a color value, check the official documentation. - /// - public IntPtr Background; - - /// - /// Pointer to a string that specifies the resource name of the class menu, as the name appears in the - /// resource file. If this member is null, windows belonging to this class have no default menu. - /// - public string MenuName; - - /// - /// A string specifying the window class name. The class name can be any name registered with - /// RegisterClass or , - /// or any of the predefined control-class names. - /// - public string ClassName; - - /// - /// A handle to a small icon that is associated with the window class. If this member is - /// , the system searches the icon resource specified by the hIcon member for an icon - /// of the appropriate size to use as the small icon. - /// - public IntPtr IconSmall; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/IconInfo.cs b/Crow/src/backends/win32/User32/Structs/IconInfo.cs deleted file mode 100644 index ff0f45c1..00000000 --- a/Crow/src/backends/win32/User32/Structs/IconInfo.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about an icon or a cursor. - /// - public struct IconInfo - { - /// - /// Specifies whether this structure defines an icon or a cursor. A - /// value of true specifies an icon; false specifies a cursor. - /// - public bool Icon; - - /// - /// The x-coordinate of a cursor's hot spot. If this structure defines - /// an icon, the hot spot is always in the center of the icon, and - /// this member is ignored. - /// - public uint XHotspot; - - /// - /// The y-coordinate of a cursor's hot spot. If this structure defines - /// an icon, the hot spot is always in the center of the icon, and - /// this member is ignored. - /// - public uint YHotspot; - - /// - /// The icon bitmask bitmap. If this structure defines a black and - /// white icon, this bitmask is formatted so that the upper half is - /// the icon AND bitmask and the lower half is the icon XOR bitmask. - /// Under this condition, the height should be an even multiple of - /// two. If this structure defines a color icon, this mask only - /// defines the AND bitmask of the icon. - /// - public IntPtr BitmapMask; - - /// - /// A handle to the icon color bitmap. This member can be optional if - /// this structure defines a black and white icon. The AND bitmask of - /// is applied with the SRCAND flag to the destination; - /// subsequently, the color bitmap is applied (using XOR) to the - /// destination by using the SRCINVERT flag. - /// - public IntPtr BitmapColor; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/MonitorInfo.cs b/Crow/src/backends/win32/User32/Structs/MonitorInfo.cs deleted file mode 100644 index 908777ca..00000000 --- a/Crow/src/backends/win32/User32/Structs/MonitorInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about a display monitor. - /// - public struct MonitorInfo - { - /// - /// The size of the structure, in bytes. Set this member to before calling the - /// function. - /// - public uint Size; - - /// - /// A structure that specifies the display monitor rectangle, expressed in virtual-screen - /// coordinates. Note that if the monitor is not the primary display monitor, some of the rectangle's - /// coordinates may be negative values. - /// - public Rect Monitor; - - /// - /// A structure that specifies the work area rectangle of the display monitor, - /// expressed in virtual-screen coordinates. Note that if the monitor is not the primary display monitor, - /// some of the rectangle's coordinates may be negative values. - /// - public Rect Work; - - /// - /// A set of flags that represent attributes of the display monitor. - /// The (currently only) defined flag is "Primary" with a value of 1, so a value of 1 means the display is - /// primary while a value of 0 means that it is not. - /// - public uint Flags; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs b/Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs deleted file mode 100644 index 8be2fa24..00000000 --- a/Crow/src/backends/win32/User32/Structs/MouseMovePoint.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about the mouse's location in screen coordinates. - /// - public struct MouseMovePoint - { - /// - /// The x-coordinate of the mouse. - /// - public int X; - - /// - /// The y-coordinate of the mouse. - /// - public int Y; - - /// - /// The time stamp of the mouse coordinate. - /// - public uint Time; - - /// - /// Additional information associated with this coordinate. - /// - public IntPtr ExtraInfo; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/Msg.cs b/Crow/src/backends/win32/User32/Structs/Msg.cs deleted file mode 100644 index f31c4db0..00000000 --- a/Crow/src/backends/win32/User32/Structs/Msg.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains message information from a thread's message queue. - /// - public struct Msg - { - /// - /// A handle to the window whose window procedure receives the message. This member is - /// when the message is a thread message. - /// - public IntPtr HWnd; - - /// - /// The message identifier. Applications can only use the low word; the high word is reserved by the system. - /// - public WindowMessage Message; - - /// - /// Additional information about the message.The exact meaning depends on the value of the - /// member. - /// - public IntPtr WParam; - - /// - /// Additional information about the message.The exact meaning depends on the value of the - /// member. - /// - public IntPtr LParam; - - /// - /// The time at which the message was posted. - /// - public uint Time; - - /// - /// The cursor position, in screen coordinates, when the message was posted. - /// - public Point Point; - - /// - public override string ToString() - { - return $"msg=0x{(int)Message:x} ({Message.ToString()}) hwnd=0x{HWnd.ToInt32():x}" - + $"wparam=0x{WParam.ToInt32():x} lparam=0x{LParam.ToInt32():x} pt={Point}"; - } - } -} diff --git a/Crow/src/backends/win32/User32/Structs/Point.cs b/Crow/src/backends/win32/User32/Structs/Point.cs deleted file mode 100644 index bd3fe05b..00000000 --- a/Crow/src/backends/win32/User32/Structs/Point.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Defines the X and Y coordinates of a point. - /// - public struct Point - { - /// - /// The X coordinate of this point. - /// - public int X; - - /// - /// The Y coordinate of this point. - /// - public int Y; - - /// - /// Initializes a new instance of the struct with the given X and Y coordinates. - /// - /// The X coordinate. - /// The Y coordinate. - public Point(int x, int y) - { - X = x; - Y = y; - } - - /// - /// Converts a structure used for interoperability with the Windows API to a - /// . - /// - /// The OpenTK.NT.Native.Point structure to convert. - public static implicit operator System.Drawing.Point(Point point) - { - return new System.Drawing.Point(point.X, point.Y); - } - - /// - /// Converts a to a - /// structure meant for interoperability with the Windows API. - /// - /// The System.Drawing.Point structure to convert. - public static implicit operator Point(System.Drawing.Point point) => new Point(point.X, point.Y); - - /// - public override string ToString() => $"{{X={X},Y={Y}}}"; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawHid.cs b/Crow/src/backends/win32/User32/Structs/RawHid.cs deleted file mode 100644 index f415e71a..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawHid.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; - -namespace OpenToolkit.NT.Native -{ - /// - /// The RawHID structure describes the format of the raw input from a Human Interface Device (HID). - /// - /// - /// Each can indicate several inputs, but all of the inputs come from the same - /// HID. The size of the array is * . - /// - public struct RawHid - { - /// - /// Size, in bytes, of each HID input in bRawData. - /// - public uint SizeHid; - - /// - /// Number of HID inputs in bRawData. - /// - public uint Count; - - /// - /// The first byte of the raw input data. - /// - public byte RawData; - - /// - /// Gets the raw input data as an array of bytes. - /// - /// An array of raw input data. - public unsafe byte[] GetRawData() - { - byte[] result = new byte[SizeHid * Count]; - - fixed (byte* dataPtr = &RawData) - { - for (int i = 0; i < result.Length; i++) - { - result[i] = *(dataPtr + i); - } - } - - return result; - } - - /// - /// Access the raw input data at a given index. - /// - /// The index at which to access the raw input data. - /// A byte of raw input data at the given index. - public unsafe byte GetRawDataAt(int index) - { - if (index < 0 || index > SizeHid * Count) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - - fixed (byte* dataPtr = &RawData) - { - return *(dataPtr + index); - } - } - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInput.cs b/Crow/src/backends/win32/User32/Structs/RawInput.cs deleted file mode 100644 index 7d8f0bfe..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInput.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains the raw input from a device. - /// - [StructLayout(LayoutKind.Sequential)] - public struct RawInput - { - /// - /// The raw input data. - /// - public RawInputHeader Header; - - /// - /// Contains device-specific raw input data. - /// - public RawInputData Data; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputData.cs b/Crow/src/backends/win32/User32/Structs/RawInputData.cs deleted file mode 100644 index 3c4c73ee..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputData.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// A union containing raw input data from a device. - /// - [StructLayout(LayoutKind.Explicit)] - public struct RawInputData - { - /// - /// If the data comes from a mouse, this is the raw input data. - /// - [FieldOffset(0)] - public RawMouse Mouse; - - /// - /// If the data comes from a keyboard, this is the raw input data. - /// - [FieldOffset(0)] - public RawKeyboard Keyboard; - - /// - /// If the data comes from a HID, this is the raw input data. - /// - [FieldOffset(0)] - public RawHid Hid; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDevice.cs b/Crow/src/backends/win32/User32/Structs/RawInputDevice.cs deleted file mode 100644 index 04242df6..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputDevice.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using OpenToolkit.Input.Hid; - -namespace OpenToolkit.NT.Native -{ - /// - /// Defines information for the raw input devices. - /// - public struct RawInputDevice - { - /// - /// Top level collection Usage page for the raw input device. - /// - public HidPage UsagePage; - - /// - /// Top level collection Usage for the raw input device. - /// - public ushort Usage; - - /// - /// Mode flag that specifies how to interpret the information provided by UsagePage and Usage. - /// By default, the operating system sends raw input from devices with the specified top level collection (TLC) - /// to the registered application as long as it has the window focus. - /// - public RawInputDeviceFlags Flags; - - /// - /// Handle to the target window. If NULL it follows the keyboard focus. - /// - public IntPtr Target; - - /// - /// Initializes a new instance of the struct for generic desktop usage. - /// - /// HID usage for the Generic Desktop page. - /// Specifies how to interpret the raw input data. - /// Handle to the target window. - public RawInputDevice(HidGenericDesktopUsage usage, RawInputDeviceFlags flags, IntPtr target) - : this((ushort)usage, flags, target, HidPage.GenericDesktop) - { - } - - /// - /// Initializes a new instance of the struct for consumer usage. - /// - /// HID usage for the Consumer page. - /// Specifies how to interpret the raw input data. - /// Handle to the target window. - public RawInputDevice(HidConsumerUsage usage, RawInputDeviceFlags flags, IntPtr target) - : this((ushort)usage, flags, target, HidPage.Consumer) - { - } - - /// - /// Initializes a new instance of the struct for simulation usage. - /// - /// HID usage for the Simulation page. - /// Specifies how to interpret the raw input data. - /// Handle to the target window. - public RawInputDevice(HidSimulationUsage usage, RawInputDeviceFlags flags, IntPtr target) - : this((ushort)usage, flags, target, HidPage.Simulation) - { - } - - private RawInputDevice(ushort usage, RawInputDeviceFlags flags, IntPtr target, HidPage usagePage) - { - Usage = usage; - Flags = flags; - Target = target; - UsagePage = usagePage; - } - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - - /// - public override string ToString() => $"{UsagePage}/{Usage}, flags: {Flags}, window: {Target}"; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs deleted file mode 100644 index 07cca2b4..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfo.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Defines the raw input data coming from any device. - /// - [StructLayout(LayoutKind.Explicit)] - public struct RawInputDeviceInfo - { - /// - /// Size, in bytes, of the structure. - /// - [FieldOffset(0)] - public uint Size; - - /// - /// Type of raw input data. - /// - [FieldOffset(4)] - public RawInputDeviceType Type; - - /// - /// If is , this is the - /// structure that defines the mouse. - /// - [FieldOffset(8)] - public RawInputDeviceInfoMouse Mouse; - - /// - /// If is , this is the - /// structure that defines the keyboard. - /// - [FieldOffset(8)] - public RawInputDeviceInfoKeyboard Keyboard; - - /// - /// If is , this is the - /// structure that defines the HID. - /// - [FieldOffset(8)] - public RawInputDeviceInfoHid Hid; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs deleted file mode 100644 index 403e221d..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoHid.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Defines the raw input data coming from the specified Human Interface Device (HID). - /// - public struct RawInputDeviceInfoHid - { - /// - /// Vendor ID for the HID. - /// - public uint VendorId; - - /// - /// Product ID for the HID. - /// - public uint ProductId; - - /// - /// Version number for the HID. - /// - public uint VersionNumber; - - /// - /// Top-level collection Usage Page for the device. - /// - public ushort UsagePage; - - /// - /// Top-level collection Usage for the device. - /// - public ushort Usage; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs deleted file mode 100644 index 62cd8376..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoKeyboard.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Defines the raw input data coming from the specified keyboard. - /// - /// - /// For the keyboard, the Usage Page is 1 and the Usage is 6. - /// - public struct RawInputDeviceInfoKeyboard - { - /// - /// Type of the keyboard. - /// - public uint Type; - - /// - /// Subtype of the keyboard. - /// - public uint SubType; - - /// - /// Scan code mode. - /// - public uint KeyboardMode; - - /// - /// Number of function keys on the keyboard. - /// - public uint NumberOfFunctionKeys; - - /// - /// Number of LED indicators on the keyboard. - /// - public uint NumberOfIndicators; - - /// - /// Total number of keys on the keyboard. - /// - public uint NumberOfKeysTotal; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs deleted file mode 100644 index fa20c44c..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputDeviceInfoMouse.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Defines the raw input data coming from the specified mouse. - /// - /// - /// For the keyboard, the Usage Page is 1 and the Usage is 2. - /// - public struct RawInputDeviceInfoMouse - { - /// - /// ID for the mouse device. - /// - public uint Id; - - /// - /// Number of buttons for the mouse. - /// - public uint NumberOfButtons; - - /// - /// Number of data points per second. This information may not be applicable for every mouse device. - /// - public uint SampleRate; - - /// - /// TRUE if the mouse has a wheel for horizontal scrolling; otherwise, FALSE. - /// - /// - /// This member is only supported under Microsoft Windows Vista and later versions. - /// - public bool HasHorizontalWheel; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs b/Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs deleted file mode 100644 index 8e87acc0..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputDeviceList.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about a raw input device. - /// - public struct RawInputDeviceList - { - /// - /// Handle to the raw input device. - /// - public IntPtr Device; - - /// - /// Type of device. - /// - public RawInputDeviceType Type; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - - /// - public override string ToString() => $"{Type}, Handle: {Device}"; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawInputHeader.cs b/Crow/src/backends/win32/User32/Structs/RawInputHeader.cs deleted file mode 100644 index 724fae5f..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawInputHeader.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains the header information that is part of the raw input data. - /// - public struct RawInputHeader - { - /// - /// Type of raw input. - /// - public RawInputDeviceType Type; - - /// - /// The size, in bytes, of the entire input packet of data. This includes plus - /// possible extra input reports in the variable length array. - /// - public uint Size; - - /// - /// Handle to the device generating the raw input data. - /// - public IntPtr Device; - - /// - /// Value passed in the wParam parameter of the message. - /// - public IntPtr Param; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawKeyboard.cs b/Crow/src/backends/win32/User32/Structs/RawKeyboard.cs deleted file mode 100644 index bc3c7466..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawKeyboard.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about the state of the keyboard. - /// - public struct RawKeyboard - { - /// - /// Scan code from the key depression. The scan code for keyboard overrun is KEYBOARD_OVERRUN_MAKE_CODE. - /// - public ushort MakeCode; - - /// - /// Flags for scan code information. - /// - public RawKeyboardScanCodeFlags Flags; - - /// - /// Reserved; must be zero. - /// - public ushort Reserved; - - /// - /// Microsoft Windows message compatible virtual-key code. For more information, see Virtual-Key Codes. - /// - public VirtualKey VKey; - - /// - /// Corresponding window message, for example , - /// , and so forth. - /// - public uint Message; - - /// - /// Device-specific additional information for the event. - /// - public uint ExtraInformation; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/RawMouse.cs b/Crow/src/backends/win32/User32/Structs/RawMouse.cs deleted file mode 100644 index 945be9fa..00000000 --- a/Crow/src/backends/win32/User32/Structs/RawMouse.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about the state of the mouse. - /// - [StructLayout(LayoutKind.Explicit)] - public struct RawMouse - { - /// - /// Mouse state. - /// - [FieldOffset(0)] - public RawMouseFlags Flags; - - /// - /// Reserved. Use instead. - /// - [FieldOffset(4)] - public uint Buttons; - - /// - /// The transition state of the mouse buttons. - /// - [FieldOffset(4)] - public RawMouseButtonFlags ButtonFlags; - - /// - /// If is , - /// this member is a signed value that specifies the wheel delta. - /// - [FieldOffset(6)] - public ushort ButtonData; - - /// - /// Raw state of the mouse buttons. - /// - [FieldOffset(8)] - public uint RawButtons; - - /// - /// Motion in the X direction. This is signed relative motion or absolute motion, - /// depending on the value of . - /// - [FieldOffset(12)] - public int LastX; - - /// - /// Motion in the Y direction. This is signed relative motion or absolute motion, - /// depending on the value of . - /// - [FieldOffset(16)] - public int LastY; - - /// - /// Device-specific additional information for the event. - /// - [FieldOffset(20)] - public uint ExtraInformation; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/Rect.cs b/Crow/src/backends/win32/User32/Structs/Rect.cs deleted file mode 100644 index 832420cb..00000000 --- a/Crow/src/backends/win32/User32/Structs/Rect.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Drawing; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Defines the coordinates of the upper-left and lower-right corners of a rectangle. - /// - /// - /// By convention, the right and bottom edges of the rectangle are normally considered exclusive. In other words, - /// the pixel whose coordinates are (right, bottom) lies immediately outside of the the rectangle. For example, - /// when is passed to the FillRect function, the rectangle is filled up to, but not including, - /// the right column and bottom row of pixels. - /// - public struct Rect - { - /// - /// Specifies the x-coordinate of the upper-left corner of the rectangle. - /// - public int Left; - - /// - /// Specifies the y-coordinate of the upper-left corner of the rectangle. - /// - public int Top; - - /// - /// Specifies the x-coordinate of the lower-right corner of the rectangle. - /// - public int Right; - - /// - /// Specifies the y-coordinate of the lower-right corner of the rectangle. - /// - public int Bottom; - - /// - /// Gets the width of the rectangle. - /// - public int Width => Right - Left; - - /// - /// Gets the height of the rectangle. - /// - public int Height => Bottom - Top; - - /// - public override string ToString() => $"{{X={Left},Y={Top},Width={Width},Height={Height}}}"; - - /// - /// Implicitly converts a structure into a structure. - /// - /// A with the same values as the given . - public static implicit operator Rectangle(Rect value) - { - return Rectangle.FromLTRB(value.Left, value.Top, value.Right, value.Bottom); - } - - /// - /// Implicitly converts a structure into a structure. - /// - /// A with the same values as the given . - public static implicit operator Rect(Rectangle value) - { - return new Rect - { - Left = value.Left, - Right = value.Right, - Top = value.Top, - Bottom = value.Bottom - }; - } - - /// - /// Creates a structure with the specified Size at location (0,0). - /// - /// The size from which to construct the new structure. - /// A structure with the given size. - public static Rect FromSize(Size value) - { - return new Rect - { - Left = 0, - Right = value.Width, - Top = 0, - Bottom = value.Height - }; - } - } - - [StructLayout(LayoutKind.Sequential)] - public struct PAINTSTRUCT - { - public IntPtr hdc; - public bool fErase; - public Rect rcPaint; - public bool fRestore; - public bool fIncUpdate; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] rgbReserved; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/StyleStruct.cs b/Crow/src/backends/win32/User32/Structs/StyleStruct.cs deleted file mode 100644 index 93cdd2c5..00000000 --- a/Crow/src/backends/win32/User32/Structs/StyleStruct.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Contains the styles for a window. - /// Both members can be or . - /// - public struct StyleStruct - { - /// - /// The previous styles for a window. - /// - public uint StyleOld; - - /// - /// The new styles for a window. - /// - public uint StyleNew; - } -} diff --git a/Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs b/Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs deleted file mode 100644 index e1b5cce6..00000000 --- a/Crow/src/backends/win32/User32/Structs/TrackMouseEvent.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Used by the function to track - /// when the mouse pointer leaves a window or hovers over a window for a specified amount of time. - /// - public struct TrackMouseEvent - { - /// - /// Set to this value to use the system default hover time-out. - /// - public const uint DefaultHoverTime = 0xFFFFFFFF; - - /// - /// The size of the structure, in bytes. - /// Set this to . - /// - public uint Size; - - /// - /// The services requested. - /// - public TrackMouseEvents Flags; - - /// - /// A handle to the window to track. - /// - public IntPtr TrackWindowHandle; - - /// - /// The hover time-out (if was specified in ), in - /// milliseconds. Can be , which means to use the system default hover time-out. - /// - public uint HoverTime; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/WindowClass.cs b/Crow/src/backends/win32/User32/Structs/WindowClass.cs deleted file mode 100644 index 57f1a6f9..00000000 --- a/Crow/src/backends/win32/User32/Structs/WindowClass.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains the window class attributes that are registered by the RegisterClass function. - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct WindowClass - { - /// - /// The class style(s). This member can be any combination of . - /// - public WindowClassStyles Style; - - /// - /// A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. - /// - public WindowProc WindowProc; - - /// - /// The number of extra bytes to allocate following the window-class structure. - /// The system initializes the bytes to zero. - /// - public int ClassExtra; - - /// - /// The number of extra bytes to allocate following the window instance. The system initializes the bytes - /// to zero. If an application uses to register a dialog box created by - /// using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. - /// - public int WindowExtra; - - /// - /// A handle to the instance that contains the window procedure for the class. - /// - public IntPtr Instance; - - /// - /// A handle to the class icon. This member must be a handle to an icon resource. - /// If this member is , the system provides a default icon. - /// - public IntPtr Icon; - - /// - /// A handle to the class cursor. This member must be a handle to a cursor resource. - /// If this member is , an application must explicitly set the cursor shape - /// whenever the mouse moves into the application's window. - /// - public IntPtr Cursor; - - /// - /// A handle to the class background brush. This member can be a handle to the brush to be used for - /// painting the background, or it can be a color value. - /// For more information on setting this to a color value, check the official documentation. - /// - public IntPtr Background; - - /// - /// Pointer to a string that specifies the resource name of the class menu, as the name appears in the - /// resource file. If this member is null, windows belonging to this class have no default menu. - /// - public string MenuName; - - /// - /// A string specifying the window class name. The class name can be any name registered with - /// RegisterClass or , - /// or any of the predefined control-class names. - /// - public string ClassName; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/WindowInfo.cs b/Crow/src/backends/win32/User32/Structs/WindowInfo.cs deleted file mode 100644 index e5df1d31..00000000 --- a/Crow/src/backends/win32/User32/Structs/WindowInfo.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains window information. - /// - public struct WindowInfo - { - /// - /// The size of the structure, in bytes. - /// - public uint Size; - - /// - /// Pointer to a RECT structure that specifies the coordinates of the window. - /// - public Rect Window; - - /// - /// Pointer to a RECT structure that specifies the coordinates of the client area. - /// - public Rect Client; - - /// - /// The window styles. For a table of window styles, see CreateWindowEx. - /// - public WindowStyles Style; - - /// - /// The extended window styles. For a table of extended window styles, see CreateWindowEx. - /// - public ExtendedWindowStyles ExtendedStyle; - - /// - /// The window status. If this member is WS_ACTIVECAPTION, the window is active. - /// Otherwise, this member is zero. - /// - public uint WindowStatus; - - /// - /// The width of the window border, in pixels. - /// - public uint WindowBordersX; - - /// - /// The height of the window border, in pixels. - /// - public uint WindowBordersY; - - /// - /// The window class atom (see RegisterClass). - /// - public ushort WindowType; - - /// - /// The Microsoft Windows version of the application that created the window. - /// - public ushort CreatorVersion; - - /// - /// The size of this structure in bytes. - /// - public static readonly uint SizeInBytes = (uint)Marshal.SizeOf(); - } -} diff --git a/Crow/src/backends/win32/User32/Structs/WindowPosition.cs b/Crow/src/backends/win32/User32/Structs/WindowPosition.cs deleted file mode 100644 index 1e3d89eb..00000000 --- a/Crow/src/backends/win32/User32/Structs/WindowPosition.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - /// - /// Contains information about the size and position of a window. - /// - [StructLayout(LayoutKind.Sequential)] - public struct WindowPosition - { - /// - /// Handle to the window. - /// - public IntPtr HWnd; - - /// - /// Specifies the position of the window in Z order (front-to-back position). - /// This member can be a handle to the window behind which this window is placed, - /// or can be one of the special values listed with the SetWindowPos function. - /// - public IntPtr HWndInsertAfter; - - /// - /// Specifies the position of the left edge of the window. - /// - public int X; - - /// - /// Specifies the position of the top edge of the window. - /// - public int Y; - - /// - /// Specifies the window width, in pixels. - /// - public int Width; - - /// - /// Specifies the window height, in pixels. - /// - public int Height; - - /// - /// Specifies the window position. - /// - public SetWindowPosFlags Flags; - } -} diff --git a/Crow/src/backends/win32/User32/Timer.cs b/Crow/src/backends/win32/User32/Timer.cs deleted file mode 100644 index 9266e811..00000000 --- a/Crow/src/backends/win32/User32/Timer.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with timers. - /// - public static class Timer - { - /// - /// Creates a timer with the specified time-out value. - /// - /// - /// A handle to the window to be associated with the timer. This window must be owned - /// by the calling thread. If a value for is passed - /// in along with an of an existing timer, that timer will be replaced in the - /// same way that an existing non-zero timer will be. - /// - /// - /// A nonzero timer identifier. If the parameter is , - /// and the does not match an existing timer then it is ignored and a new - /// timer ID is generated. - /// If the parameter is not - /// and the window specified by already has a timer with the value - /// , then the existing timer is replaced by the new timer. When - /// replaces a timer, the timer is reset. - /// Therefore, a message will be sent after the current time-out value elapses, but the previously set - /// time-out value is ignored. - /// If the call is not intended to replace an existing timer, - /// should be 0 if the is . - /// - /// The time-out value, in milliseconds. - /// - /// A pointer to the function to be notified when the time-out value elapses. For more information about - /// the function, see . If is null, the system posts - /// a message to the application queue. The - /// member of the message's structure contains - /// the value of the parameter. - /// - /// - /// If the function succeeds and the parameter is , - /// the return value is an integer identifying the new timer. An application can pass this value to the - /// function to destroy the timer. - /// - [DllImport(Library, SetLastError = true)] - public static extern UIntPtr SetTimer - ( - [In] [Optional] IntPtr window, - [In] UIntPtr timerID, - [In] uint elapse, - [In] [Optional] TimerProc timerFunc - ); - - /// - /// Destroys the specified timer. - /// - /// - /// A handle to the window associated with the specified timer. This value must be the same as the window - /// value passed to the - /// function that created the timer. - /// - /// - /// The timer to be destroyed. If the window handle passed to - /// is valid, this parameter must be the same as - /// the timerID value passed to . If the application - /// calls with window set to - /// , this parameter must be the timer identifier returned by - /// . - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool KillTimer - ( - [In] [Optional] IntPtr window, - [In] UIntPtr timerID - ); - } - } -} diff --git a/Crow/src/backends/win32/User32/User32.cs b/Crow/src/backends/win32/User32/User32.cs deleted file mode 100644 index a4883d05..00000000 --- a/Crow/src/backends/win32/User32/User32.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace OpenToolkit.NT.Native -{ - /// - /// Provides a subset of functions from the Windows API, specifically those that are imported from user32.dll. - /// - public static partial class User32 - { - /// - /// The filename of the dynamic link library (DLL) that contains these functions. - /// - public const string Library = "user32.dll"; - } -} diff --git a/Crow/src/backends/win32/User32/Window.cs b/Crow/src/backends/win32/User32/Window.cs deleted file mode 100644 index 4aa9b21a..00000000 --- a/Crow/src/backends/win32/User32/Window.cs +++ /dev/null @@ -1,969 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Security; -using System.Text; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with windows. - /// - public static class Window - { - /// - /// Calculates the required size of the window rectangle, based on the desired client-rectangle size. - /// The window rectangle can then be passed to the CreateWindow function to create a window whose - /// client area is the desired size. - /// - /// - /// A pointer to a structure that contains the coordinates of the top-left and - /// bottom-right corners of the desired client area. When the function returns, the structure contains - /// the coordinates of the top-left and bottom-right corners of the window to accommodate the desired - /// client area. - /// - /// - /// The window style of the window whose required size is to be calculated. - /// Note that you cannot specify the style. - /// - /// Indicates whether the window has a menu. - /// - /// If the function succeeds, the return value is nonzero. - /// If the function fails, the return value is zero. - /// To get extended error information, call . - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool AdjustWindowRect - ( - [In] [Out] ref Rect rect, - [In] WindowStyles style, - [In] bool hasMenu - ); - - /// - /// Calculates the required size of the window rectangle, based on the desired client-rectangle size. - /// The window rectangle can then be passed to the - /// - /// function to create a window whose client area is the desired size. - /// - /// - /// A pointer to a structure that contains the coordinates of the top-left and - /// bottom-right corners of the desired client area. When the function returns, the structure contains - /// the coordinates of the top-left and bottom-right corners of the window to accommodate the - /// desired client area. - /// - /// - /// The window style of the window whose required size is to be calculated. - /// Note that you cannot specify the style. - /// - /// Indicates whether the window has a menu. - /// - /// The extended window style of the window whose required size is to be calculated. - /// - /// - /// If the function succeeds, the return value is nonzero. - /// If the function fails, the return value is zero. - /// To get extended error information, call . - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool AdjustWindowRectEx - ( - [In] [Out] ref Rect rect, - [In] WindowStyles style, - [In] bool hasMenu, - [In] ExtendedWindowStyles extendedStyle - ); - - /// - /// A constant that can be used in all CreateWindowEx overloads to specify special behavior. - /// For more information, see any CreateWindowEx overload. - /// - public const int UseDefault = unchecked((int)0x80000000); - - /// - /// Creates an overlapped, pop-up, or child window with an extended window style; otherwise, - /// this function is identical to the CreateWindow function. - /// - /// The extended window style of the window being created. - /// A string specifying the window class name. - /// - /// The window name. If the window style specifies a title bar, - /// the window title pointed to by is displayed in the title bar. - /// - /// The style of the window being created. - /// - /// The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is - /// the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, - /// x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner - /// of the parent window's client area. - /// If x is set to , the system selects the default position for the window's - /// upper-left corner and ignores the y parameter. is valid only for overlapped - /// windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. - /// - /// - /// The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is - /// the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, - /// y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left - /// corner of the parent window's client area. For a list box y is the initial y-coordinate of the - /// upper-left corner of the list box's client area relative to the upper-left corner of the parent - /// window's client area. - /// If an overlapped window is created with the style bit set and - /// the x parameter is set to , then the y parameter determines how the window - /// is shown. If the y parameter is , then the window manager calls - /// with the - /// flag after the window has been created. If the y parameter is some other value, then the window manager - /// calls with that value as the nCmdShow parameter. - /// - /// - /// The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in - /// screen coordinates, or . - /// If nWidth is , the system selects a default width and height for the window; - /// the default width extends from the initial x-coordinates to the right edge of the screen; the default - /// height extends from the initial y-coordinate to the top of the icon area. - /// is valid only for overlapped windows; if is - /// specified for a pop-up or child window, the and - /// parameter are set to zero. - /// - /// - /// The height, in device units, of the window. For overlapped windows, is the - /// window's height, in screen coordinates. - /// If the parameter is set to , - /// the system ignores . - /// - /// - /// A handle to the parent or owner window of the window being created. To create a child window or an - /// owned window, supply a valid window handle. This parameter is optional for pop-up windows. - /// - /// - /// A handle to a menu, or specifies a child-window identifier, depending on the window style. - /// For an overlapped or pop-up window, identifies the menu to be used with the - /// window; it can be if the class menu is to be used. - /// For a child window, specifies the child-window identifier, an integer value - /// used by a dialog box control to notify its parent about events. The application determines the - /// child-window identifier; it must be unique for all child windows with the same parent window. - /// - /// - /// A handle to the instance of the module to be associated with the window. - /// - /// - /// Pointer to a value to be passed to the window through the structure - /// ( member) pointed to by the lParam param of the - /// message. - /// This message is sent to the created window by this function before it returns. - /// - /// - /// If the function succeeds, the return value is a handle to the new window. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - public static extern IntPtr CreateWindowEx - ( - [In] ExtendedWindowStyles extendedStyle, - [In] [Optional] string className, - [In] [Optional] string windowName, - [In] WindowStyles style, - [In] int x, - [In] int y, - [In] int width, - [In] int height, - [In] [Optional] IntPtr parentWindow, - [In] [Optional] IntPtr menu, - [In] [Optional] IntPtr moduleInstance, - [In] [Optional] IntPtr createParam - ); - - /// - /// Creates an overlapped, pop-up, or child window with an extended window style; otherwise, - /// this function is identical to the CreateWindow function. - /// - /// The extended window style of the window being created. - /// A pointer to a string specifying the window class name. - /// - /// The window name. If the window style specifies a title bar, - /// the window title pointed to by is displayed in the title bar. - /// - /// The style of the window being created. - /// - /// The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is - /// the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, - /// x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner - /// of the parent window's client area. - /// If x is set to , the system selects the default position for the window's - /// upper-left corner and ignores the y parameter. is valid only for overlapped - /// windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. - /// - /// - /// The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is - /// the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, - /// y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left - /// corner of the parent window's client area. For a list box y is the initial y-coordinate of the - /// upper-left corner of the list box's client area relative to the upper-left corner of the parent - /// window's client area. - /// If an overlapped window is created with the style bit set and - /// the x parameter is set to , then the y parameter determines how the window - /// is shown. If the y parameter is , then the window manager calls - /// with the - /// flag after the window has been created. If the y parameter is some other value, then the window manager - /// calls with that value as the nCmdShow parameter. - /// - /// - /// The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in - /// screen coordinates, or . - /// If nWidth is , the system selects a default width and height for the window; - /// the default width extends from the initial x-coordinates to the right edge of the screen; the default - /// height extends from the initial y-coordinate to the top of the icon area. - /// is valid only for overlapped windows; if is - /// specified for a pop-up or child window, the and - /// parameter are set to zero. - /// - /// - /// The height, in device units, of the window. For overlapped windows, is the - /// window's height, in screen coordinates. - /// If the parameter is set to , - /// the system ignores . - /// - /// - /// A handle to the parent or owner window of the window being created. To create a child window or an - /// owned window, supply a valid window handle. This parameter is optional for pop-up windows. - /// - /// - /// A handle to a menu, or specifies a child-window identifier, depending on the window style. - /// For an overlapped or pop-up window, identifies the menu to be used with the - /// window; it can be if the class menu is to be used. - /// For a child window, specifies the child-window identifier, an integer value - /// used by a dialog box control to notify its parent about events. The application determines the - /// child-window identifier; it must be unique for all child windows with the same parent window. - /// - /// - /// A handle to the instance of the module to be associated with the window. - /// - /// - /// Pointer to a value to be passed to the window through the structure - /// ( member) pointed to by the lParam param of the - /// message. - /// This message is sent to the created window by this function before it returns. - /// - /// - /// If the function succeeds, the return value is a handle to the new window. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - public static extern IntPtr CreateWindowEx - ( - [In] ExtendedWindowStyles extendedStyle, - [In] [Optional] IntPtr className, - [In] [Optional] string windowName, - [In] WindowStyles style, - [In] int x, - [In] int y, - [In] int width, - [In] int height, - [In] [Optional] IntPtr parentWindow, - [In] [Optional] IntPtr menu, - [In] [Optional] IntPtr moduleInstance, - [In] [Optional] IntPtr createParam - ); - - /// - /// Creates an overlapped, pop-up, or child window with an extended window style; otherwise, - /// this function is identical to the CreateWindow function. - /// - /// The extended window style of the window being created. - /// - /// A class atom created by a previous call to RegisterClass or - /// . - /// - /// - /// The window name. If the window style specifies a title bar, - /// the window title pointed to by is displayed in the title bar. - /// - /// The style of the window being created. - /// - /// The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is - /// the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, - /// x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner - /// of the parent window's client area. - /// If x is set to , the system selects the default position for the window's - /// upper-left corner and ignores the y parameter. is valid only for overlapped - /// windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. - /// - /// - /// The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is - /// the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, - /// y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left - /// corner of the parent window's client area. For a list box y is the initial y-coordinate of the - /// upper-left corner of the list box's client area relative to the upper-left corner of the parent - /// window's client area. - /// If an overlapped window is created with the style bit set and - /// the x parameter is set to , then the y parameter determines how the window - /// is shown. If the y parameter is , then the window manager calls - /// with the - /// flag after the window has been created. If the y parameter is some other value, then the window manager - /// calls with that value as the nCmdShow parameter. - /// - /// - /// The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in - /// screen coordinates, or . - /// If nWidth is , the system selects a default width and height for the window; - /// the default width extends from the initial x-coordinates to the right edge of the screen; the default - /// height extends from the initial y-coordinate to the top of the icon area. - /// is valid only for overlapped windows; if is - /// specified for a pop-up or child window, the and - /// parameter are set to zero. - /// - /// - /// The height, in device units, of the window. For overlapped windows, is the - /// window's height, in screen coordinates. - /// If the parameter is set to , - /// the system ignores . - /// - /// - /// A handle to the parent or owner window of the window being created. To create a child window or an - /// owned window, supply a valid window handle. This parameter is optional for pop-up windows. - /// - /// - /// A handle to a menu, or specifies a child-window identifier, depending on the window style. - /// For an overlapped or pop-up window, identifies the menu to be used with the - /// window; it can be if the class menu is to be used. - /// For a child window, specifies the child-window identifier, an integer value - /// used by a dialog box control to notify its parent about events. The application determines the - /// child-window identifier; it must be unique for all child windows with the same parent window. - /// - /// - /// A handle to the instance of the module to be associated with the window. - /// - /// - /// Pointer to a value to be passed to the window through the structure - /// ( member) pointed to by the lParam param of the - /// message. - /// This message is sent to the created window by this function before it returns. - /// - /// - /// If the function succeeds, the return value is a handle to the new window. - /// If the function fails, the return value is . - /// To get extended error information, call . - /// - public static IntPtr CreateWindowEx - ( - [In] ExtendedWindowStyles extendedStyle, - [In] [Optional] ushort classAtom, - [In] [Optional] string windowName, - [In] WindowStyles style, - [In] int x, - [In] int y, - [In] int width, - [In] int height, - [In] [Optional] IntPtr parentWindow, - [In] [Optional] IntPtr menu, - [In] [Optional] IntPtr moduleInstance, - [In] [Optional] IntPtr createParam - ) - { - return CreateWindowEx - ( - extendedStyle, - new IntPtr(classAtom), - windowName, - style, - x, - y, - width, - height, - parentWindow, - menu, - moduleInstance, - createParam - ); - } - - /// - /// Destroys the specified window. The function sends - /// and messages to the window to deactivate it and remove the - /// keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, - /// destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain - /// (if the window is at the top of the viewer chain). - /// If the specified window is a parent or owner window, automatically - /// destroys the associated child or owned windows when it destroys the parent or owner window. The - /// function first destroys child or owned windows, and then it destroys the parent or owner window. - /// - /// A handle to the window to be destroyed. - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool DestroyWindow([In] IntPtr window); - - /// - /// Passes message information to the specified window procedure. - /// - /// - /// The previous window procedure. If this value is obtained by calling the - /// function with the index parameter set to - /// or DWL_DLGPROC, it is actually either the address of - /// a window or dialog box procedure, or a special internal value meaningful only to - /// . - /// - /// A handle to the window procedure to receive the message. - /// The message. - /// - /// Additional message-specific information. - /// The contents of this parameter depend on the value of the parameter. - /// - /// - /// Additional message-specific information. - /// The contents of this parameter depend on the value of the parameter. - /// - /// - /// The return value specifies the result of the message processing and depends on the message sent. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - public static extern IntPtr CallWindowProc - ( - [In] IntPtr previousWindowFunc, - [In] IntPtr window, - [In] WindowMessage msg, - [In] IntPtr wparam, - [In] IntPtr lparam - ); - - /// - /// Sets the current process as dots per inch (dpi) aware. Note: is - /// subject to a possible race condition if a DLL caches dpi settings during initialization. - /// For this reason, it is recommended that dpi-aware be set through the application (.exe) manifest - /// rather than by calling . - /// - /// - /// If the function succeeds, the return value is true. - /// Otherwise, the return value is false. - /// - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool SetProcessDPIAware(); - - /// - /// Changes the window procedure of the specified window. - /// - /// - /// A handle to the window and, indirectly, the class to which the window belongs. - /// - /// The replacement window procedure. - /// - /// If the function succeeds, the return value is the previous value - /// of the specified 32-bit integer. - /// If the function fails, the return value is zero. - /// To get extended error information, call . - /// - public static IntPtr SetWindowLong(IntPtr window, WindowProc newProc) - { - return SetWindowLong - ( - window, - GetWindowLongIndex.WindowProcedure, - Marshal.GetFunctionPointerForDelegate(newProc) - ); - } - - /// - /// Changes an attribute of the specified window. - /// The function also sets a value at the specified offset in the extra window memory. - /// - /// - /// A handle to the window and, indirectly, the class to which the window belongs. - /// - /// - /// One of the pre-defined values specifying the offset to the value to be set. - /// - /// The replacement value. - /// - /// If the function succeeds, the return value is the previous value of the - /// specified 32-bit integer. - /// If the function fails, the return value is zero. - /// To get extended error information, call . - /// - public static IntPtr SetWindowLong(IntPtr window, GetWindowLongIndex index, IntPtr newLong) - { - return SetWindowLong(window, (int)index, newLong); - } - - /// - /// Changes an attribute of the specified window. The function also sets a value at the specified offset - /// in the extra window memory. - /// - /// - /// A handle to the window and, indirectly, the class to which the window belongs. - /// - /// - /// The zero-based offset to the value to be set. Valid values are in the range zero through the number - /// of bytes of extra window memory, minus the size of an . - /// - /// The replacement value. - /// - /// If the function succeeds, the return value is the previous value of the - /// specified 32-bit integer. - /// If the function fails, the return value is zero. - /// To get extended error information, call . - /// - /// - /// This method is a wrapper around both the SetWindowLong (32-bit) and the SetWindowLongPtr (64-bit) - /// version of these functions. - /// This method will always call the "correct" function for this machine, - /// and return the value wrapped in an . - /// This method will throw a if the Windows API function returns a value - /// that indicates failure. - /// - /// An error occurs in the native function call. - public static IntPtr SetWindowLong(IntPtr window, int index, IntPtr newLong) - { - //Kernel32.SetLastError(0); - - IntPtr result; - if (IntPtr.Size == 8) - { - result = SetWindowLongPtr(window, index, newLong); - } - else - { - result = new IntPtr(SetWindowLong(window, index, newLong.ToInt32())); - } - - int error; - if (result == IntPtr.Zero && (error = Marshal.GetLastWin32Error()) != 0) - { - throw new Win32Exception(error, "Failed to modify window border."); - } - - return result; - } - - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - private static extern int SetWindowLong - ( - [In] IntPtr window, - [In] int index, - [In] int newLong - ); - - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - private static extern IntPtr SetWindowLongPtr - ( - [In] IntPtr window, - [In] int index, - [In] IntPtr newLong - ); - - /// - /// Retrieves information about the specified window. The function also retrieves the value at a - /// specified offset into the extra window memory. - /// - /// - /// A handle to the window and, indirectly, the class to which the window belongs. - /// - /// - /// One of the pre-defined values specifying the offset to the value to be retrieved. - /// - /// - /// If the function succeeds, the return value is the requested value. - /// If the function fails, the return value is zero. To get extended error information, call - /// . - /// If SetWindowLong or SetWindowLongPtr has not been called previously, - /// GetWindowLongPtr returns zero for values in the extra window or class memory. - /// - /// - /// This method is a wrapper around both the GetWindowLong (32-bit) and the GetWindowLongPtr - /// (64-bit) version of these functions. - /// This method will always call the "correct" function for this machine, - /// and return the value wrapped in an . - /// - public static IntPtr GetWindowLong(IntPtr window, GetWindowLongIndex index) - { - return GetWindowLong(window, (int)index); - } - - /// - /// Retrieves information about the specified window. The function also retrieves the value at a specified - /// offset into the extra window memory. - /// - /// - /// A handle to the window and, indirectly, the class to which the window belongs. - /// - /// - /// The zero-based offset to the value to be retrieved. Valid values are in the range zero through the - /// number of bytes of extra window memory, minus the size of a . - /// - /// - /// If the function succeeds, the return value is the requested value. - /// If the function fails, the return value is zero. To get extended error information, - /// call . - /// If SetWindowLong or SetWindowLongPtr has not been called previously, GetWindowLongPtr returns zero for - /// values in the extra window or class memory. - /// - /// - /// This method is a wrapper around both the GetWindowLong (32-bit) and the GetWindowLongPtr (64-bit) - /// version of these functions. - /// This method will always call the "correct" function for this machine, - /// and return the value wrapped in an . - /// - public static IntPtr GetWindowLong(IntPtr window, int index) - { - if (IntPtr.Size == 8) - { - return GetWindowLongPtr(window, index); - } - else - { - return new IntPtr(GetWindowLongPrivate(window, index)); - } - } - - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - private static extern int GetWindowLongPrivate([In] IntPtr window, [In] int index); - - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - private static extern IntPtr GetWindowLongPtr([In] IntPtr window, [In] int index); - - /// - /// Calls the default window procedure to provide default processing for any window messages that an - /// application does not process. This function ensures that every message is processed. - /// - /// A handle to the window procedure that received the message. - /// The message. - /// - /// Additional message information. The content of this parameter depends on the value of the - /// parameter. - /// - /// - /// Additional message information. The content of this parameter depends on the value of the - /// parameter. - /// - /// The return value is the result of the message processing and depends on the message. - [DllImport(Library, CharSet = CharSet.Unicode)] - public static extern IntPtr DefWindowProc - ( - [In] IntPtr window, - [In] WindowMessage msg, - [In] IntPtr wparam, - [In] IntPtr lparam - ); - - /// - /// Sets the specified window's show state. - /// - /// A handle to the window. - /// Controls how the window is to be shown. - /// If the window was previously visible, the return value is true. Otherwise false. - [DllImport(Library, SetLastError = true)] - [SuppressUnmanagedCodeSecurity] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ShowWindow([In] IntPtr window, [In] ShowWindowCommand showCommand); - - [DllImport(Library, SetLastError = true)] - [SuppressUnmanagedCodeSecurity] - public static extern IntPtr BeginPaint(IntPtr hwnd, out PAINTSTRUCT lpPaint); - - [DllImport(Library, SetLastError = true)] - [SuppressUnmanagedCodeSecurity] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool EndPaint(IntPtr hWnd, [In] ref PAINTSTRUCT lpPaint); - - [DllImport(Library, SetLastError = true)] - [SuppressUnmanagedCodeSecurity] - public static extern IntPtr GetDC(IntPtr hWnd); - - [DllImport(Library, SetLastError = true)] - [SuppressUnmanagedCodeSecurity] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); - - /// - /// Copies the text of the specified window's title bar (if it has one) into a buffer. If the specified - /// window is a control, the text of the control is copied. However, - /// cannot retrieve the text of a control in another - /// application. - /// - /// A handle to the window or control containing the text. - /// - /// The buffer that will receive the text. If the string is as long or longer than the buffer, - /// the string is truncated and terminated with a null character. - /// - /// - /// The maximum number of characters to copy to the buffer, including the null character. - /// If the text exceeds this limit, it is truncated. - /// - /// - /// If the function succeeds, the return value is the length, in characters, of the copied string, not - /// including the terminating null character. If the window has no title bar or text, if the title bar - /// is empty, or if the window or control handle is invalid, the return value is zero. To get extended - /// error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - public static extern int GetWindowText - ( - [In] IntPtr window, - [In] [Out] StringBuilder windowText, - [In] int maxCharCount - ); - - /// - /// Changes the text of the specified window's title bar (if it has one). If the specified window is a - /// control, the text of the control is changed. However, - /// cannot change the text of a control in another application. - /// - /// A handle to the window or control whose text is to be changed. - /// The new title or control text. - /// - /// If the function succeeds, the return value is nonzero. - /// If the function fails, the return value is zero. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool SetWindowText - ( - [In] IntPtr window, - [In] [Optional] string newText - ); - - /// - /// Changes the size, position, and Z order of a child, pop-up, or top-level window. These windows are - /// ordered according to their appearance on the screen. The topmost window receives the highest rank - /// and is the first window in the Z order. - /// - /// A handle to the window. - /// - /// A handle to the window to precede the positioned window in the Z order. - /// This parameter must be a window handle. - /// - /// The new position of the left side of the window, in client coordinates. - /// The new position of the top of the window, in client coordinates. - /// The new width of the window, in pixels. - /// The new height of the window, in pixels. - /// The window sizing and positioning flags. - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool SetWindowPos - ( - [In] IntPtr window, - [In] [Optional] IntPtr windowInsertAfter, - [In] int x, - [In] int y, - [In] int cx, - [In] int cy, - [In] SetWindowPosFlags flags - ); - - /// - /// Changes the size, position, and Z order of a child, pop-up, or top-level window. - /// These windows are ordered according to their appearance on the screen. The topmost window receives - /// the highest rank and is the first window in the Z order. - /// - /// One of the pre-defined values for window Z order positioning. - /// - /// A handle to the window to precede the positioned window in the Z order. - /// This parameter must be a window handle. - /// - /// The new position of the left side of the window, in client coordinates. - /// The new position of the top of the window, in client coordinates. - /// The new width of the window, in pixels. - /// The new height of the window, in pixels. - /// The window sizing and positioning flags. - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool SetWindowPos - ( - [In] IntPtr window, - [In] [Optional] SetWindowPosHwndEnum windowInsertAfter, - [In] int x, - [In] int y, - [In] int cx, - [In] int cy, - [In] SetWindowPosFlags flags - ); - - /// - /// Brings the thread that created the specified window into the foreground and activates the window. - /// Keyboard input is directed to the window, and various visual cues are changed for the user. - /// The system assigns a slightly higher priority to the thread that created the foreground window - /// than it does to other threads. - /// - /// - /// A handle to the window that should be activated and brought to the foreground. - /// - /// - /// If the window was brought to the foreground, the return value is true. - /// If the window was not brought to the foreground, the return value is false. - /// - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool SetForegroundWindow([In] IntPtr window); - - /// - /// Brings the specified window to the top of the Z order. If the window is a top-level window, it is - /// activated. If the window is a child window, the top-level parent window associated with the child - /// window is activated. - /// - /// A handle to the window to bring to the top of the Z order. - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool BringWindowToTop([In] IntPtr window); - - /// - /// Changes the parent window of the specified child window. - /// - /// A handle to the child window. - /// - /// A handle to the new parent window. If this parameter is - /// , the desktop window becomes the new parent window. - /// - /// - /// If the function succeeds, the return value is a handle to the previous parent window. - /// If the function fails, the return value is null. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - public static extern IntPtr SetParent - ( - [In] IntPtr childWindow, - [In] [Optional] IntPtr newParent - ); - - /// - /// Retrieves information about the specified window. - /// - /// A handle to the window whose information is to be retrieved. - /// - /// A pointer to a structure to receive the information. - /// Note that you must set the member to - /// before calling this function. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetWindowInfo([In] IntPtr hwnd, [In] [Out] ref WindowInfo wi); - - /// - /// Determines the visibility state of the specified window. - /// - /// A handle to the window to be tested. - /// - /// If the specified window, its parent window, its parent's parent window, and so forth, have the - /// style, the return value is true. Otherwise, - /// the return value is false. - /// Because the return value specifies whether the window has the - /// style, it may be true even if the window is totally obscured by other windows. - /// - [DllImport(Library)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool IsWindowVisible([In] IntPtr window); - - /// - /// Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given - /// in screen coordinates that are relative to the upper-left corner of the screen. - /// - /// Handle to the window whose client coordinates are to be retrieved. - /// - /// Pointer to a structure that receives the screen coordinates of the upper-left and - /// lower-right corners of the window. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetWindowRect([In] IntPtr windowHandle, [Out] out Rect windowRectangle); - - /// - /// Retrieves the coordinates of a window's client area. The client coordinates specify the upper-left - /// and lower-right corners of the client area. Because client coordinates are relative to the upper-left - /// corner of a window's client area, the coordinates of the upper-left corner are (0,0). - /// - /// Handle to the window whose client coordinates are to be retrieved. - /// - /// Pointer to a structure that receives the client coordinates. - /// The and members are zero. The - /// and members contain the width and height of the window. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// To get extended error information, call . - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetClientRect([In] IntPtr windowHandle, [Out] out Rect clientRectangle); - - /// - /// Converts the screen coordinates of a specified point on the screen to client-area coordinates. - /// - /// Handle to the window whose client area will be used for the conversion. - /// - /// Pointer to a structure that specifies the screen coordinates to be converted. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ScreenToClient([In] IntPtr window, ref Point point); - - /// - /// Converts the client-area coordinates of a specified point to screen coordinates. - /// - /// Handle to the window whose client area will be used for the conversion. - /// - /// Pointer to a structure that contains the client coordinates to be converted. - /// The new screen coordinates are copied into this structure if the function succeeds. - /// - /// - /// If the function succeeds, the return value is true. - /// If the function fails, the return value is false. - /// - [SuppressUnmanagedCodeSecurity] - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ClientToScreen([In] IntPtr window, [In] [Out] ref Point point); - } - } -} diff --git a/Crow/src/backends/win32/User32/WindowClass.cs b/Crow/src/backends/win32/User32/WindowClass.cs deleted file mode 100644 index b0462076..00000000 --- a/Crow/src/backends/win32/User32/WindowClass.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace OpenToolkit.NT.Native -{ - public static partial class User32 - { - /// - /// Provides a subset of functions from the Windows API, - /// specifically those imported from user32.dll that deal with window classes. - /// - public static class WindowClass - { - /// - /// Retrieves information about a window class, - /// including a handle to the small icon associated with the window class. - /// - /// - /// A handle to the instance of the application that created the class. - /// To retrieve information about classes defined by the system (such as buttons or list boxes), - /// set this parameter to . - /// - /// - /// A string containing the class name. The name must be that of a preregistered class or a class - /// registered by a previous call to the RegisterClass or - /// function. - /// - /// - /// A pointer to a structure - /// that receives the information about the class. - /// - /// - /// If the function finds a matching class and successfully copies the data, the return value is - /// true. - /// If the function does not find a matching class and successfully copy the data, the return value is - /// false. To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetClassInfoEx - ( - [In] [Optional] IntPtr instance, - [In] string className, - [Out] out ExtendedWindowClass extendedWindowClass - ); - - /// - /// Retrieves information about a window class, - /// including a handle to the small icon associated with the window class. - /// - /// - /// A handle to the instance of the application that created the class. - /// To retrieve information about classes defined by the system (such as buttons or list boxes), - /// set this parameter to . - /// - /// - /// A pointer to a string containing the class name. - /// The name must be that of a preregistered class or a class registered by a previous call to the - /// RegisterClass or function. - /// - /// - /// A pointer to a structure - /// that receives the information about the class. - /// - /// - /// If the function finds a matching class and successfully copies the data, the return value is - /// true. - /// If the function does not find a matching class and successfully copy the data, the return value - /// is false. To get extended error information, call . - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetClassInfoEx - ( - [In] IntPtr instance, - [In] IntPtr className, - [Out] out ExtendedWindowClass extendedWindowClass - ); - - /// - /// Retrieves information about a window class, - /// including a handle to the small icon associated with the window class. - /// - /// - /// A handle to the instance of the application that created the class. - /// To retrieve information about classes defined by the system (such as buttons or list boxes), - /// set this parameter to . - /// - /// - /// A class atom created by a previous call to RegisterClass - /// or . - /// - /// - /// A pointer to a structure - /// that receives the information about the class. - /// - /// - /// If the function finds a matching class and successfully copies the data, the return value is - /// true. - /// If the function does not find a matching class and successfully copy the data, the return value is - /// false. To get extended error information, call . - /// - public static bool GetClassInfoEx - ( - [In] IntPtr instance, - [In] ushort classAtom, - [Out] out ExtendedWindowClass extendedWindowStyle - ) - { - return GetClassInfoEx(instance, new IntPtr(classAtom), out extendedWindowStyle); - } - - /// - /// Registers a window class for subsequent use in calls to the CreateWindow or - /// function. - /// - /// - /// A pointer to a structure. You must fill the structure with the - /// appropriate class attributes before passing it to the function. - /// - /// - /// If the function succeeds, the return value is a class atom that uniquely identifies the class being - /// registered. This atom can only be used by the CreateWindow, - /// , - /// GetClassInfo, , FindWindow, - /// FindWindowEx, and functions - /// and the IActiveIMMap::FilterClientWindows method. - /// If the function fails, the return value is zero. - /// To get extended error information, call . - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - public static extern ushort RegisterClassEx([In] ref ExtendedWindowClass extendedWindowClass); - - /// - /// Unregisters a window class, freeing the memory required for the class. - /// - /// - /// A string specifying the window class name. This class name must have been - /// registered by a previous call to the RegisterClass or - /// function. - /// - /// A handle to the instance of the module that created the class. - /// - /// If the function succeeds, the return value is true. - /// If the class could not be found or if a window still exists that was created with the class, the return - /// value is false. To get extended error information, call . - /// - /// - /// Before calling this function, an application must destroy all windows created with the - /// specified class. - /// All window classes that an application registers are unregistered when it terminates. - /// - [DllImport(Library, SetLastError = true, CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool UnregisterClass([In] string className, [In] [Optional] IntPtr moduleInstance); - - /// - /// Unregisters a window class, freeing the memory required for the class. - /// - /// - /// A pointer to a string specifying the window class name. This class name must - /// have been registered by a previous call to the RegisterClass or - /// function. - /// - /// A handle to the instance of the module that created the class. - /// - /// If the function succeeds, the return value is true. - /// If the class could not be found or if a window still exists that was created with the class, the return - /// value is false. To get extended error information, call . - /// - /// - /// Before calling this function, an application must destroy all windows created with the - /// specified class. - /// All window classes that an application registers are unregistered when it terminates. - /// - [DllImport(Library, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool UnregisterClass - ( - [In] IntPtr className, - [In] [Optional] IntPtr moduleInstance - ); - - /// - /// Unregisters a window class, freeing the memory required for the class. - /// - /// - /// A class atom created by a previous call to the RegisterClass or - /// function. - /// - /// A handle to the instance of the module that created the class. - /// - /// If the function succeeds, the return value is true. - /// If the class could not be found or if a window still exists that was created with the class, the return - /// value is false. To get extended error information, call . - /// - /// - /// Before calling this function, an application must destroy all windows created with the - /// specified class. - /// All window classes that an application registers are unregistered when it terminates. - /// - public static bool UnregisterClass([In] ushort classAtom, [In] [Optional] IntPtr moduleInstance) - { - return UnregisterClass(new IntPtr(classAtom), moduleInstance); - } - } - } -} diff --git a/Crow/src/backends/win32/WinBackend.cs b/Crow/src/backends/win32/WinBackend.cs deleted file mode 100644 index f05814bd..00000000 --- a/Crow/src/backends/win32/WinBackend.cs +++ /dev/null @@ -1,478 +0,0 @@ -// -// XLibBackend.cs -// -// Author: -// Jean-Philippe Bruyère -// -// 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.Diagnostics; -using System.Runtime.InteropServices; -using System.Text; -using OpenToolkit.NT.Native; - -namespace Crow.Win32 -{ - - public class Win32Backend : IBackend - { - public void CleanUp() - { - User32.Window.ReleaseDC(handle, hdc); - User32.Window.DestroyWindow(handle); - } - - public void Flush() - { - iFace.surf.Flush (); - //throw new NotImplementedException(); - } - - WindowProc WindowProcedureDelegate; - string className = "myWindowClass"; - IntPtr instance = Marshal.GetHINSTANCE(typeof(Win32Backend).Module); - IntPtr handle = IntPtr.Zero; - IntPtr hdc = IntPtr.Zero; - Interface iFace; - - public void Init(Interface _iFace) - { - iFace = _iFace; - - WindowProcedureDelegate = WindowProcedure; - - Rect rect = new Rect - { - Left = iFace.ClientRectangle.Left, - Top = iFace.ClientRectangle.Top, - Right = iFace.ClientRectangle.Right, - Bottom = iFace.ClientRectangle.Bottom - }; - - User32.Window.AdjustWindowRectEx(ref rect, 0, false, 0); - - ExtendedWindowClass wc = new ExtendedWindowClass - { - Size = ExtendedWindowClass.SizeInBytes, - Style = 0, - WindowProc = WindowProcedureDelegate, - ClassExtra = 0, - WindowExtra = 0, - Instance = instance, - Icon = IntPtr.Zero, - Cursor = User32.Cursor.LoadCursor(CursorName.Arrow), - //Background = Gdi32.GetStockObject(GetStockObjectType.BlackBrush), - MenuName = null, - ClassName = className, - }; - - ushort atom = User32.WindowClass.RegisterClassEx(ref wc); - - handle = User32.Window.CreateWindowEx( - ExtendedWindowStyles.ClientEdge, - className, - "The title of my window", - WindowStyles.OverlappedWindow, - - rect.Left, - rect.Top, - rect.Width, - rect.Height, - IntPtr.Zero, - IntPtr.Zero, - instance, - IntPtr.Zero - ); - - User32.Window.ShowWindow(handle, ShowWindowCommand.Show); - - hdc = User32.Window.GetDC(handle); - iFace.surf = new Crow.Cairo.Win32Surface(hdc); - - } - - public void ProcessEvents() - { - Msg msg; - while (User32.Message.PeekMessage(out msg, IntPtr.Zero, 0, 0, PeekMessageActions.Remove)) - { - User32.Message.TranslateMessage(ref msg); - User32.Message.DispatchMessage(ref msg); - } - } - - public bool IsDown (Key key) { - return false; - } - public bool Shift { - get { - throw new NotImplementedException (); - } - } - - public bool Ctrl { - get { - throw new NotImplementedException (); - } - } - - public bool Alt { - get { - throw new NotImplementedException (); - } - } - - void HandleWindowPositionChanged(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam) - { - var pos = Marshal.PtrToStructure(lParam); - if (pos.HWnd == handle) - { - Rectangle bounds = new Rectangle(pos.X, pos.Y, pos.Width, pos.Height); - - User32.Window.SetWindowPos - ( - handle, - IntPtr.Zero, - bounds.X, - bounds.Y, - bounds.Width, - bounds.Height, - SetWindowPosFlags.NoZOrder | SetWindowPosFlags.NoOwnerZOrder | - SetWindowPosFlags.NoActivate | SetWindowPosFlags.NoSendChanging - ); - bounds.Left = bounds.Top = 0; - iFace.ProcessResize (bounds); - } - } - - static Key GetKey(int code) - { - switch (code) - { - // 0 - 15 - case 0: return Key.NoSymbol; - case 1: return Key.Escape; - case 2: return Key.key_1; - case 3: return Key.key_2; - case 4: return Key.key_3; - case 5: return Key.key_4; - case 6: return Key.key_5; - case 7: return Key.key_6; - case 8: return Key.key_7; - case 9: return Key.key_8; - case 10: return Key.key_9; - case 11: return Key.key_0; - case 12: return Key.minus; - case 13: return Key.plus; - case 14: return Key.BackSpace; - case 15: return Key.Tab; - - // 16-31 - case 16: return Key.Q; - case 17: return Key.W; - case 18: return Key.E; - case 19: return Key.R; - case 20: return Key.T; - case 21: return Key.Y; - case 22: return Key.U; - case 23: return Key.I; - case 24: return Key.O; - case 25: return Key.P; - case 26: return Key.bracketleft; - case 27: return Key.bracketright; - case 28: return Key.Return; - case 29: return Key.Control_L; - case 30: return Key.A; - case 31: return Key.S; - - // 32 - 47 - case 32: return Key.D; - case 33: return Key.F; - case 34: return Key.G; - case 35: return Key.H; - case 36: return Key.J; - case 37: return Key.K; - case 38: return Key.L; - case 39: return Key.semicolon; - case 40: return Key.quotedbl; - case 41: return Key.grave; - case 42: return Key.Shift_L; - case 43: return Key.backslash; - case 44: return Key.Z; - case 45: return Key.X; - case 46: return Key.C; - case 47: return Key.V; - - // 48 - 63 - case 48: return Key.B; - case 49: return Key.N; - case 50: return Key.M; - case 51: return Key.comma; - case 52: return Key.period; - case 53: return Key.slash; - case 54: return Key.Shift_R; - case 55: return Key.Print; - case 56: return Key.Alt_L; - case 57: return Key.space; - case 58: return Key.Caps_Lock; - case 59: return Key.F1; - case 60: return Key.F2; - case 61: return Key.F3; - case 62: return Key.F4; - case 63: return Key.F5; - - // 64 - 79 - case 64: return Key.F6; - case 65: return Key.F7; - case 66: return Key.F8; - case 67: return Key.F9; - case 68: return Key.F10; - case 69: return Key.Num_Lock; - case 70: return Key.Scroll_Lock; - case 71: return Key.Home; - case 72: return Key.Up; - case 73: return Key.Page_Up; - case 74: return Key.KP_Subtract; - case 75: return Key.Left; - case 76: return Key.KP_5; - case 77: return Key.Right; - case 78: return Key.KP_Add; - case 79: return Key.End; - - // 80 - 95 - case 80: return Key.Down; - case 81: return Key.Page_Down; - case 82: return Key.Insert; - case 83: return Key.Delete; - case 84: return Key.NoSymbol; - case 85: return Key.NoSymbol; - case 86: return Key.NoSymbol; - case 87: return Key.F11; - case 88: return Key.F12; - case 89: return Key.Pause; - case 90: return Key.NoSymbol; - case 91: return Key.Meta_L; - case 92: return Key.Meta_R; - case 93: return Key.Menu; - case 94: return Key.NoSymbol; - case 95: return Key.NoSymbol; - - // 96 - 106 - case 96: return Key.NoSymbol; - case 97: return Key.NoSymbol; - case 98: return Key.NoSymbol; - case 99: return Key.NoSymbol; - case 100: return Key.F13; - case 101: return Key.F14; - case 102: return Key.F15; - case 103: return Key.F16; - case 104: return Key.F17; - case 105: return Key.F18; - case 106: return Key.F19; - - default: return Key.NoSymbol; - } - } - const long ExtendedBit = 1 << 24; // Used to distinguish left and right control, alt and enter keys. - - void handleKeyboard (IntPtr lParam, IntPtr wParam, bool pressed) { - bool extended = (lParam.ToInt64() & ExtendedBit) != 0; - uint scancode = (uint)((lParam.ToInt64() >> 16) & 0xFF); - //ushort repeat_count = unchecked((ushort)((ulong)lParam.ToInt64() & 0xffffu)); -// VirtualKey vkey = (VirtualKey)wParam; -// var key = WinKeyMap.TranslateKey(scancode, vkey, extended, false, out bool is_valid); - Key k = GetKey ((int)scancode); - - if (pressed) - iFace.ProcessKeyDown (k); - else - iFace.ProcessKeyUp (k); - } - void handleChar (IntPtr lParam, IntPtr wParam) { - char c = IntPtr.Size == 4 ? - (char)wParam.ToInt32() : - (char)wParam.ToInt64(); - - if (!char.IsControl (c)) - iFace.ProcessKeyPress (c); - } - - - - IntPtr WindowProcedure(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam) - { - var result = IntPtr.Zero; - - - switch (message) - { - case WindowMessage.MouseMove: - iFace.ProcessMouseMove - ((int)((uint)lParam.ToInt32() & 0x0000FFFF), (int)(((uint)lParam.ToInt32() & 0xFFFF0000) >> 16)); - break; - case WindowMessage.LButtonDown: - iFace.ProcessMouseButtonDown(Crow.MouseButton.Left); - return IntPtr.Zero; - case WindowMessage.RButtonDown: - iFace.ProcessMouseButtonDown(Crow.MouseButton.Right); - return IntPtr.Zero; - case WindowMessage.MButtonDown: - iFace.ProcessMouseButtonDown(Crow.MouseButton.Middle); - return IntPtr.Zero; - case WindowMessage.LButtonUp: - iFace.ProcessMouseButtonUp(Crow.MouseButton.Left); - return IntPtr.Zero; - case WindowMessage.RButtonUp: - iFace.ProcessMouseButtonUp(Crow.MouseButton.Right); - return IntPtr.Zero; - case WindowMessage.MButtonUp: - iFace.ProcessMouseButtonUp(Crow.MouseButton.Middle); - return IntPtr.Zero; - case WindowMessage.MouseWheel: - iFace.ProcessMouseWheelChanged ((((long)wParam << 32) >> 48) / 120.0f); - return IntPtr.Zero; - case WindowMessage.MouseHWheel: - iFace.ProcessMouseWheelChanged ((((long)wParam << 32) >> 48) / 120.0f); - return IntPtr.Zero; - case WindowMessage.KeyDown: - case WindowMessage.SystemKeyDown: - handleKeyboard (lParam, wParam, true); - return IntPtr.Zero; - case WindowMessage.KeyUp: - case WindowMessage.SystemKeyUp: - handleKeyboard (lParam, wParam, false); - return IntPtr.Zero; - case WindowMessage.Char: - handleChar (lParam, wParam); - break; - case WindowMessage.WindowPosChanged: - HandleWindowPositionChanged(handle, message, wParam, lParam); - break; - - - /*case WindowMessage.Activate: - HandleActivate(handle, message, wParam, lParam); - break; - - case WindowMessage.EnterMenuLoop: - case WindowMessage.EnterSizeMove: - HandleEnterModalLoop(handle, message, wParam, lParam); - break; - - case WindowMessage.ExitMenuLoop: - case WindowMessage.ExitSizeMove: - HandleExitModalLoop(handle, message, wParam, lParam); - break; - - case WindowMessage.EraseBackground: - // This is triggered only when the client area changes. - // As such it does not affect steady-state performance. - break; - - - case WindowMessage.StyleChanged: - HandleStyleChanged(handle, message, wParam, lParam); - break; - - case WindowMessage.Size: - HandleSize(handle, message, wParam, lParam); - break; - - case WindowMessage.SetCursor: - result = HandleSetCursor(handle, message, wParam, lParam); - break; - - case WindowMessage.CaptureChanged: - HandleCaptureChanged(handle, message, wParam, lParam); - break; - - case WindowMessage.Char: - HandleChar(handle, message, wParam, lParam); - break; - - - - case WindowMessage.MouseLeave: - HandleMouseLeave(handle, message, wParam, lParam); - break; - - case WindowMessage.MouseWheel: - HandleMouseWheel(handle, message, wParam, lParam); - return IntPtr.Zero; - - case WindowMessage.MouseHWheel: - HandleMouseHWheel(handle, message, wParam, lParam); - return IntPtr.Zero; - - - // Keyboard events: - case WindowMessage.KeyDown: - case WindowMessage.KeyUp: - case WindowMessage.SystemKeyDown: - case WindowMessage.SystemKeyUp: - HandleKeyboard(handle, message, wParam, lParam); - return IntPtr.Zero; - - case WindowMessage.SystemChar: - return IntPtr.Zero; - - case WindowMessage.KillFocus: - HandleKillFocus(handle, message, wParam, lParam); - break; - - case WindowMessage.DropFiles: - HandleDropFiles(handle, message, wParam, lParam); - break; - - case WindowMessage.Create: - HandleCreate(handle, message, wParam, lParam); - break; - case WindowMessage.Paint: - dc = User32.Window.BeginPaint(handle, out paintStruct); - - return IntPtr.Zero;*/ - case WindowMessage.Close: - User32.Window.DestroyWindow(handle); - return IntPtr.Zero; - case WindowMessage.Destroy: - User32.Message.PostQuitMessage(0); - //User32.WindowClass.UnregisterClass(className, instance); - break; - } - - if (result != IntPtr.Zero) - return result; - - return User32.Window.DefWindowProc(handle, message, wParam, lParam); - } - - public void SetCursor (MouseCursors newCur) - { - //throw new NotImplementedException (); - } - - public void SetCursorPosition (int x, int y) - { - throw new NotImplementedException (); - } - } -} - diff --git a/Crow/src/backends/xcb/XCBBackend.cs b/Crow/src/backends/xcb/XCBBackend.cs deleted file mode 100644 index 46d72670..00000000 --- a/Crow/src/backends/xcb/XCBBackend.cs +++ /dev/null @@ -1,528 +0,0 @@ -// -// XLibBackend.cs -// -// Author: -// Jean-Philippe Bruyère -// -// 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.Diagnostics; -using System.Runtime.InteropServices; -using System.Text; - - - -namespace Crow.XCB -{ - using xcb_window_t = System.UInt32; - using xcb_pixmap_t = System.UInt32; - using xcb_cursor_t = System.UInt32; - using xcb_font_t = System.UInt32; - using xcb_colormap_t = System.UInt32; - using xcb_atom_t = System.UInt32; - using xcb_drawable_t = System.UInt32; - using xcb_visualid_t = System.UInt32; - using xcb_keysym_t = System.UInt32; - using xcb_keycode_t = System.Byte; - using xcb_timestamp_t = System.UInt32; - - using xcb_void_cookie_t = System.UInt32; - - public class XCBBackend : IBackend - { - const byte XCB_COPY_FROM_PARENT = 0; - - #region struct an enums - - enum xcb_window_class_t : ushort { - COPY_FROM_PARENT = 0, - INPUT_OUTPUT = 1, - INPUT_ONLY = 2 - } - - enum xcb_button_t : byte { - Left = 1, - Middle, - Right, - WheelUp, - WheelDown, - But6, - But7, - But8, - But9, - But10, - } - - [Flags] - enum xcb_event_mask_t : uint { - NO_EVENT = 0, - KEY_PRESS = 1, - KEY_RELEASE = 2, - BUTTON_PRESS = 4, - BUTTON_RELEASE = 8, - ENTER_WINDOW = 16, - LEAVE_WINDOW = 32, - POINTER_MOTION = 64, - POINTER_MOTION_HINT = 128, - BUTTON_1_MOTION = 256, - BUTTON_2_MOTION = 512, - BUTTON_3_MOTION = 1024, - BUTTON_4_MOTION = 2048, - BUTTON_5_MOTION = 4096, - BUTTON_MOTION = 8192, - KEYMAP_STATE = 16384, - EXPOSURE = 32768, - VISIBILITY_CHANGE = 65536, - STRUCTURE_NOTIFY = 131072, - RESIZE_REDIRECT = 262144, - SUBSTRUCTURE_NOTIFY = 524288, - SUBSTRUCTURE_REDIRECT = 1048576, - FOCUS_CHANGE = 2097152, - PROPERTY_CHANGE = 4194304, - COLOR_MAP_CHANGE = 8388608, - OWNER_GRAB_BUTTON = 16777216 - } - - enum xcb_event_type : byte { - KEY_PRESS = 2, - KEY_RELEASE, - BUTTON_PRESS, - BUTTON_RELEASE, - MOTION_NOTIFY, - ENTER_NOTIFY, - LEAVE_NOTIFY, - FOCUS_IN, - FOCUS_OUT, - KEYMAP_NOTIFY, - EXPOSE, - GRAPHICS_EXPOSURE, - NO_EXPOSURE, - VISIBILITY_NOTIFY, - CREATE_NOTIFY, - DESTROY_NOTIFY, - UNMAP_NOTIFY, - MAP_NOTIFY, - MAP_REQUEST, - REPARENT_NOTIFY, - CONFIGURE_NOTIFY, - CONFIGURE_REQUEST, - GRAVITY_NOTIFY, - RESIZE_REQUEST, - CIRCULATE_NOTIFY, - CIRCULATE_REQUEST, - PROPERTY_NOTIFY, - SELECTION_CLEAR, - SELECTION_REQUEST, - SELECTION_NOTIFY, - COLORMAP_NOTIFY, - CLIENT_MESSAGE, - MAPPING_NOTIFY, - GE_GENERIC, - } - [Flags] - enum xcb_cw_t : uint { - BACK_PIXMAP = 1, - BACK_PIXEL = 2, - BORDER_PIXMAP = 4, - BORDER_PIXEL = 8, - BIT_GRAVITY = 16, - WIN_GRAVITY = 32, - BACKING_STORE = 64, - BACKING_PLANES = 128, - BACKING_PIXEL = 256, - OVERRIDE_REDIRECT = 512, - SAVE_UNDER = 1024, - EVENT_MASK = 2048, - DONT_PROPAGATE = 4096, - COLORMAP = 8192, - CURSOR = 16384 - } - - [StructLayout(LayoutKind.Sequential)] - struct xcb_generic_event_t{ - public xcb_event_type response_type; /**< Type of the response */ - public byte pad0; /**< Padding */ - public UInt16 sequence; /**< Sequence number */ - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] - UInt32[] pad; - public UInt32 full_sequence; /**< full sequence */ - } - - [StructLayout(LayoutKind.Explicit, Size = 32)] - struct xcb_event_t{ - [FieldOffsetAttribute(0)] - public xcb_event_type response_type; - - [FieldOffsetAttribute(1)] - public byte detail; - [FieldOffsetAttribute(1)] - public xcb_keycode_t keycode; - [FieldOffsetAttribute(1)] - public xcb_button_t button; - - [FieldOffsetAttribute(2)] - public UInt16 sequence; - [FieldOffsetAttribute(4)] - public xcb_timestamp_t time; - [FieldOffsetAttribute(8)] - public xcb_window_t root; - - //expose event fields - [FieldOffsetAttribute(4)] - public xcb_window_t window; - [FieldOffsetAttribute(8)] - public UInt16 x; - [FieldOffsetAttribute(10)] - public UInt16 y; - [FieldOffsetAttribute(12)] - public UInt16 width; - [FieldOffsetAttribute(14)] - public UInt16 height; - [FieldOffsetAttribute(14)] - public UInt16 count; - /// - - [FieldOffsetAttribute(12)] - public xcb_window_t evt; - [FieldOffsetAttribute(16)] - public xcb_window_t child; - [FieldOffsetAttribute(20)] - public UInt16 root_x; - [FieldOffsetAttribute(22)] - public UInt16 root_y; - [FieldOffsetAttribute(24)] - public UInt16 event_x; - [FieldOffsetAttribute(26)] - public UInt16 event_y; - [FieldOffsetAttribute(28)] - public UInt16 state; - [FieldOffsetAttribute(30)] - public byte same_screen; - - [FieldOffsetAttribute(31)] - public byte same_screen_focus; - } - - [StructLayout(LayoutKind.Sequential)] - struct xcb_key_press_event_t { - public xcb_event_type response_type; - public xcb_keycode_t detail; - public UInt16 sequence; - public xcb_timestamp_t time; - public xcb_window_t root; - public xcb_window_t evt; - public xcb_window_t child; - public UInt16 root_x; - public UInt16 root_y; - public UInt16 event_x; - public UInt16 event_y; - public UInt16 state; - public byte same_screen; - byte pad0; - } - [StructLayout(LayoutKind.Sequential)] - struct xcb_button_press_event_t { - public xcb_event_type response_type; - public xcb_button_t detail; - public UInt16 sequence; - public xcb_timestamp_t time; - public xcb_window_t root; - public xcb_window_t evt; - public xcb_window_t child; - public UInt16 root_x; - public UInt16 root_y; - public UInt16 event_x; - public UInt16 event_y; - public UInt16 state; - public byte same_screen; - byte pad0; - } - - [StructLayout(LayoutKind.Sequential)] - struct xcb_motion_notify_event_t { - public xcb_event_type response_type; - public byte detail; - public UInt16 sequence; - public xcb_timestamp_t time; - public xcb_window_t root; - public xcb_window_t evt; - public xcb_window_t child; - public UInt16 root_x; - public UInt16 root_y; - public UInt16 event_x; - public UInt16 event_y; - public UInt16 state; - public byte same_screen; - byte pad0; - } - [StructLayout(LayoutKind.Sequential)] - struct xcb_iterator_t { - public IntPtr data; - public int rem; - public int index; - } - - [StructLayout(LayoutKind.Sequential)] - struct xcb_screen_t { - public xcb_window_t root; - public xcb_colormap_t default_colormap; - public UInt32 white_pixel; - public UInt32 black_pixel; - public UInt32 current_input_masks; - public UInt16 width_in_pixels; - public UInt16 height_in_pixels; - public UInt16 width_in_millimeters; - public UInt16 height_in_millimeters; - public UInt16 min_installed_maps; - public UInt16 max_installed_maps; - public xcb_visualid_t root_visual; - public byte backing_stores; - public byte save_unders; - public byte root_depth; - public byte allowed_depths_len; - } - - [StructLayout(LayoutKind.Sequential)] - struct xcb_visualtype_t { - public xcb_visualid_t visual_id; - public byte _class; - public byte bits_per_rgb_value; - public UInt16 colormap_entries; - public UInt32 red_mask; - public UInt32 green_mask; - public UInt32 blue_mask; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - byte[] pad; - } - - [StructLayout(LayoutKind.Sequential)] - struct xcb_generic_reply_t{ - public byte response_type; /**< Type of the response */ - byte pad0; /**< Padding */ - public UInt16 sequence; /**< Sequence number */ - public UInt32 length; /**< Length of the response */ - } - #endregion - - - #region pinvoke XCB - [DllImportAttribute ("xcb")] - static extern IntPtr xcb_connect(string displayName, IntPtr screenNum); - [DllImportAttribute("xcb")] - static extern IntPtr xcb_get_setup(IntPtr connection); - [DllImportAttribute("xcb")] - static extern IntPtr xcb_flush(IntPtr connection); - [DllImportAttribute("xcb")] - static extern UInt32 xcb_generate_id(IntPtr connection); - - [DllImportAttribute("xcb")] - static extern xcb_iterator_t xcb_setup_roots_iterator(IntPtr setup); - [DllImportAttribute("xcb")] - static extern xcb_iterator_t xcb_screen_allowed_depths_iterator(IntPtr scr); - [DllImportAttribute("xcb")] - static extern xcb_iterator_t xcb_depth_visuals_iterator(IntPtr depth); - - [DllImportAttribute("xcb")] - static extern void xcb_screen_next(ref xcb_iterator_t scr_iterator); - [DllImportAttribute("xcb")] - static extern void xcb_depth_next(ref xcb_iterator_t depth_iterator); - [DllImportAttribute("xcb")] - static extern void xcb_visualtype_next(ref xcb_iterator_t depth_visual_iterator); - - [DllImportAttribute("xcb")] - static extern xcb_void_cookie_t xcb_create_window(IntPtr connection, byte depth, xcb_window_t win, UInt32 parent, - Int16 x, Int16 y, UInt16 width, UInt16 height, UInt16 border, - xcb_window_class_t _class, xcb_visualid_t visual, xcb_cw_t mask, IntPtr valueList); - [DllImportAttribute("xcb")] - static extern xcb_void_cookie_t xcb_map_window(IntPtr conn, xcb_window_t window); - [DllImportAttribute("xcb")] - static extern void xcb_disconnect(IntPtr connection); - - [DllImportAttribute("xcb")] - static extern IntPtr xcb_poll_for_event(IntPtr connection); - - - #endregion - - Interface iFace; - - IntPtr conn; - - XKB.XCBKeyboard Keyboard; - - - #region IBackend implementation - public void Init (Interface _iFace) - { - iFace = _iFace; - - conn = xcb_connect (null, IntPtr.Zero); - - - Keyboard = new XKB.XCBKeyboard (conn, iFace); - - xcb_iterator_t scr_it = xcb_setup_roots_iterator (xcb_get_setup (conn)); - IntPtr screen = scr_it.data; - - xcb_screen_t scr = (xcb_screen_t)Marshal.PtrToStructure (screen, typeof(xcb_screen_t)); - - xcb_window_t win = xcb_generate_id (conn); - - xcb_cw_t mask = xcb_cw_t.BACK_PIXEL | xcb_cw_t.EVENT_MASK; - uint[] values = { - scr.black_pixel, - (uint)( - xcb_event_mask_t.EXPOSURE | - xcb_event_mask_t.POINTER_MOTION | - xcb_event_mask_t.BUTTON_PRESS | - xcb_event_mask_t.BUTTON_RELEASE | - xcb_event_mask_t.KEY_PRESS | - xcb_event_mask_t.KEY_RELEASE - ) - }; - - IntPtr intPtr = IntPtr.Zero; - - unsafe - { - fixed(uint* pValues = values) - intPtr = new IntPtr((void *) pValues); - xcb_create_window (conn, XCB_COPY_FROM_PARENT, win, scr.root, 0,0,(ushort)iFace.ClientRectangle.Width, (ushort)iFace.ClientRectangle.Height,0, - xcb_window_class_t.INPUT_OUTPUT, scr.root_visual, mask, intPtr); - } - - - xcb_map_window (conn, win); - - xcb_flush (conn); - - - IntPtr visual = findVisual (scr_it, scr.root_visual); - - loadCursors (); - - iFace.surf = new Crow.Cairo.XcbSurface (conn, win, visual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height); - } - - public void CleanUp () - { - Keyboard.Destroy (); - - xcb_disconnect (conn); - } - public void Flush () { - xcb_flush (conn); - } - - public void ProcessEvents () - { - IntPtr evtPtr = xcb_poll_for_event (conn); - if (evtPtr == IntPtr.Zero) - return; - xcb_event_t evt = (xcb_event_t)Marshal.PtrToStructure (evtPtr, typeof(xcb_event_t)); - - switch (evt.response_type) { - case xcb_event_type.EXPOSE: - if (evt.width > 0) - iFace.ProcessResize (new Rectangle (0, 0, evt.width, evt.height)); - break; - case xcb_event_type.MOTION_NOTIFY: - iFace.ProcessMouseMove (evt.event_x, evt.event_y); - break; - case xcb_event_type.BUTTON_PRESS: - if (evt.button == xcb_button_t.WheelUp) - iFace.ProcessMouseWheelChanged (Interface.WheelIncrement); - else if(evt.button == xcb_button_t.WheelDown) - iFace.ProcessMouseWheelChanged (-Interface.WheelIncrement); - else - iFace.ProcessMouseButtonDown ((MouseButton)(evt.detail - 1)); - break; - case xcb_event_type.BUTTON_RELEASE: - if (evt.button == xcb_button_t.WheelUp || evt.button == xcb_button_t.WheelDown) - break; - iFace.ProcessMouseButtonUp ((MouseButton)(evt.detail - 1)); - break; - case xcb_event_type.KEY_PRESS: - Keyboard.HandleEvent (evt.keycode, true); - break; - case xcb_event_type.KEY_RELEASE: - Keyboard.HandleEvent (evt.keycode, false); - break; - default: - Console.WriteLine ("unknown event"); - break; - } - } - public bool IsDown (Key key) { - return false; - } - public bool Shift { - get { return Keyboard.Shift; } - } - public bool Ctrl { - get { return Keyboard.Ctrl; } - } - public bool Alt { - get { return Keyboard.Alt;} - } - #endregion - - void loadCursors () - { - //Load cursors - XCursor.Cross = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.cross").Cursors [0]; - XCursor.Default = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.arrow").Cursors [0]; - XCursor.NW = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.top_left_corner").Cursors [0]; - XCursor.NE = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.top_right_corner").Cursors [0]; - XCursor.SW = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.bottom_left_corner").Cursors [0]; - XCursor.SE = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.bottom_right_corner").Cursors [0]; - XCursor.H = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.sb_h_double_arrow").Cursors [0]; - XCursor.V = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.sb_v_double_arrow").Cursors [0]; - XCursor.Text = XCursorFile.Load (iFace, "#Crow.Images.Icons.Cursors.ibeam").Cursors [0]; - } - - static IntPtr findVisual (xcb_iterator_t scr_it, xcb_visualid_t visualId){ - for (; scr_it.rem > 0; xcb_screen_next (ref scr_it)) { - xcb_iterator_t depth_it = xcb_screen_allowed_depths_iterator (scr_it.data); - for (; depth_it.rem > 0; xcb_depth_next (ref depth_it)) { - xcb_iterator_t visual_it = xcb_depth_visuals_iterator (depth_it.data); - for (; visual_it.rem > 0; xcb_visualtype_next (ref visual_it)) { - xcb_visualtype_t visual = (xcb_visualtype_t)Marshal.PtrToStructure (visual_it.data, typeof(xcb_visualtype_t)); - if (visualId == visual.visual_id) - return visual_it.data; - } - } - } - return IntPtr.Zero; - } - - public void SetCursor (MouseCursors newCur) - { - //throw new NotImplementedException (); - } - - public void SetCursorPosition (int x, int y) - { - throw new NotImplementedException (); - } - } -} - diff --git a/Crow/src/backends/xcb/XCBKeyboard.cs b/Crow/src/backends/xcb/XCBKeyboard.cs deleted file mode 100644 index 5043ec37..00000000 --- a/Crow/src/backends/xcb/XCBKeyboard.cs +++ /dev/null @@ -1,2605 +0,0 @@ -// -// XCBKeyboard.cs -// -// Author: -// Jean-Philippe Bruyère -// -// 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; - -namespace Crow.XKB -{ - using xkb_keycode_t = System.UInt32; - using xkb_mod_index_t = System.UInt32; - - public class XCBKeyboard - { - enum xkb_keysym : uint { - NoSymbol = 0x000000, - VoidSymbol = 0xffffff, - BackSpace = 0xff08, - Tab = 0xff09, - Linefeed = 0xff0a, - Clear = 0xff0b, - Return = 0xff0d, - Pause = 0xff13, - Scroll_Lock = 0xff14, - Sys_Req = 0xff15, - Escape = 0xff1b, - Delete = 0xffff, - Multi_key = 0xff20, - Codeinput = 0xff37, - SingleCandidate = 0xff3c, - MultipleCandidate = 0xff3d, - PreviousCandidate = 0xff3e, - Kanji = 0xff21, - Muhenkan = 0xff22, - Henkan_Mode = 0xff23, - Henkan = 0xff23, - Romaji = 0xff24, - Hiragana = 0xff25, - Katakana = 0xff26, - Hiragana_Katakana = 0xff27, - Zenkaku = 0xff28, - Hankaku = 0xff29, - Zenkaku_Hankaku = 0xff2a, - Touroku = 0xff2b, - Massyo = 0xff2c, - Kana_Lock = 0xff2d, - Kana_Shift = 0xff2e, - Eisu_Shift = 0xff2f, - Eisu_toggle = 0xff30, - Kanji_Bangou = 0xff37, - Zen_Koho = 0xff3d, - Mae_Koho = 0xff3e, - Home = 0xff50, - Left = 0xff51, - Up = 0xff52, - Right = 0xff53, - Down = 0xff54, - Prior = 0xff55, - Page_Up = 0xff55, - Next = 0xff56, - Page_Down = 0xff56, - End = 0xff57, - Begin = 0xff58, - Select = 0xff60, - Print = 0xff61, - Execute = 0xff62, - Insert = 0xff63, - Undo = 0xff65, - Redo = 0xff66, - Menu = 0xff67, - Find = 0xff68, - Cancel = 0xff69, - Help = 0xff6a, - Break = 0xff6b, - Mode_switch = 0xff7e, - script_switch = 0xff7e, - Num_Lock = 0xff7f, - KP_Space = 0xff80, - KP_Tab = 0xff89, - KP_Enter = 0xff8d, - KP_F1 = 0xff91, - KP_F2 = 0xff92, - KP_F3 = 0xff93, - KP_F4 = 0xff94, - KP_Home = 0xff95, - KP_Left = 0xff96, - KP_Up = 0xff97, - KP_Right = 0xff98, - KP_Down = 0xff99, - KP_Prior = 0xff9a, - KP_Page_Up = 0xff9a, - KP_Next = 0xff9b, - KP_Page_Down = 0xff9b, - KP_End = 0xff9c, - KP_Begin = 0xff9d, - KP_Insert = 0xff9e, - KP_Delete = 0xff9f, - KP_Equal = 0xffbd, - KP_Multiply = 0xffaa, - KP_Add = 0xffab, - KP_Separator = 0xffac, - KP_Subtract = 0xffad, - KP_Decimal = 0xffae, - KP_Divide = 0xffaf, - KP_0 = 0xffb0, - KP_1 = 0xffb1, - KP_2 = 0xffb2, - KP_3 = 0xffb3, - KP_4 = 0xffb4, - KP_5 = 0xffb5, - KP_6 = 0xffb6, - KP_7 = 0xffb7, - KP_8 = 0xffb8, - KP_9 = 0xffb9, - F1 = 0xffbe, - F2 = 0xffbf, - F3 = 0xffc0, - F4 = 0xffc1, - F5 = 0xffc2, - F6 = 0xffc3, - F7 = 0xffc4, - F8 = 0xffc5, - F9 = 0xffc6, - F10 = 0xffc7, - F11 = 0xffc8, - L1 = 0xffc8, - F12 = 0xffc9, - L2 = 0xffc9, - F13 = 0xffca, - L3 = 0xffca, - F14 = 0xffcb, - L4 = 0xffcb, - F15 = 0xffcc, - L5 = 0xffcc, - F16 = 0xffcd, - L6 = 0xffcd, - F17 = 0xffce, - L7 = 0xffce, - F18 = 0xffcf, - L8 = 0xffcf, - F19 = 0xffd0, - L9 = 0xffd0, - F20 = 0xffd1, - L10 = 0xffd1, - F21 = 0xffd2, - R1 = 0xffd2, - F22 = 0xffd3, - R2 = 0xffd3, - F23 = 0xffd4, - R3 = 0xffd4, - F24 = 0xffd5, - R4 = 0xffd5, - F25 = 0xffd6, - R5 = 0xffd6, - F26 = 0xffd7, - R6 = 0xffd7, - F27 = 0xffd8, - R7 = 0xffd8, - F28 = 0xffd9, - R8 = 0xffd9, - F29 = 0xffda, - R9 = 0xffda, - F30 = 0xffdb, - R10 = 0xffdb, - F31 = 0xffdc, - R11 = 0xffdc, - F32 = 0xffdd, - R12 = 0xffdd, - F33 = 0xffde, - R13 = 0xffde, - F34 = 0xffdf, - R14 = 0xffdf, - F35 = 0xffe0, - R15 = 0xffe0, - Shift_L = 0xffe1, - Shift_R = 0xffe2, - Control_L = 0xffe3, - Control_R = 0xffe4, - Caps_Lock = 0xffe5, - Shift_Lock = 0xffe6, - Meta_L = 0xffe7, - Meta_R = 0xffe8, - Alt_L = 0xffe9, - Alt_R = 0xffea, - Super_L = 0xffeb, - Super_R = 0xffec, - Hyper_L = 0xffed, - Hyper_R = 0xffee, - ISO_Lock = 0xfe01, - ISO_Level2_Latch = 0xfe02, - ISO_Level3_Shift = 0xfe03, - ISO_Level3_Latch = 0xfe04, - ISO_Level3_Lock = 0xfe05, - ISO_Level5_Shift = 0xfe11, - ISO_Level5_Latch = 0xfe12, - ISO_Level5_Lock = 0xfe13, - ISO_Group_Shift = 0xff7e, - ISO_Group_Latch = 0xfe06, - ISO_Group_Lock = 0xfe07, - ISO_Next_Group = 0xfe08, - ISO_Next_Group_Lock = 0xfe09, - ISO_Prev_Group = 0xfe0a, - ISO_Prev_Group_Lock = 0xfe0b, - ISO_First_Group = 0xfe0c, - ISO_First_Group_Lock = 0xfe0d, - ISO_Last_Group = 0xfe0e, - ISO_Last_Group_Lock = 0xfe0f, - ISO_Left_Tab = 0xfe20, - ISO_Move_Line_Up = 0xfe21, - ISO_Move_Line_Down = 0xfe22, - ISO_Partial_Line_Up = 0xfe23, - ISO_Partial_Line_Down = 0xfe24, - ISO_Partial_Space_Left = 0xfe25, - ISO_Partial_Space_Right = 0xfe26, - ISO_Set_Margin_Left = 0xfe27, - ISO_Set_Margin_Right = 0xfe28, - ISO_Release_Margin_Left = 0xfe29, - ISO_Release_Margin_Right = 0xfe2a, - ISO_Release_Both_Margins = 0xfe2b, - ISO_Fast_Cursor_Left = 0xfe2c, - ISO_Fast_Cursor_Right = 0xfe2d, - ISO_Fast_Cursor_Up = 0xfe2e, - ISO_Fast_Cursor_Down = 0xfe2f, - ISO_Continuous_Underline = 0xfe30, - ISO_Discontinuous_Underline = 0xfe31, - ISO_Emphasize = 0xfe32, - ISO_Center_Object = 0xfe33, - ISO_Enter = 0xfe34, - dead_grave = 0xfe50, - dead_acute = 0xfe51, - dead_circumflex = 0xfe52, - dead_tilde = 0xfe53, - dead_perispomeni = 0xfe53, - dead_macron = 0xfe54, - dead_breve = 0xfe55, - dead_abovedot = 0xfe56, - dead_diaeresis = 0xfe57, - dead_abovering = 0xfe58, - dead_doubleacute = 0xfe59, - dead_caron = 0xfe5a, - dead_cedilla = 0xfe5b, - dead_ogonek = 0xfe5c, - dead_iota = 0xfe5d, - dead_voiced_sound = 0xfe5e, - dead_semivoiced_sound = 0xfe5f, - dead_belowdot = 0xfe60, - dead_hook = 0xfe61, - dead_horn = 0xfe62, - dead_stroke = 0xfe63, - dead_abovecomma = 0xfe64, - dead_psili = 0xfe64, - dead_abovereversedcomma = 0xfe65, - dead_dasia = 0xfe65, - dead_doublegrave = 0xfe66, - dead_belowring = 0xfe67, - dead_belowmacron = 0xfe68, - dead_belowcircumflex = 0xfe69, - dead_belowtilde = 0xfe6a, - dead_belowbreve = 0xfe6b, - dead_belowdiaeresis = 0xfe6c, - dead_invertedbreve = 0xfe6d, - dead_belowcomma = 0xfe6e, - dead_currency = 0xfe6f, - dead_lowline = 0xfe90, - dead_aboveverticalline = 0xfe91, - dead_belowverticalline = 0xfe92, - dead_longsolidusoverlay = 0xfe93, - dead_a = 0xfe80, - dead_A = 0xfe81, - dead_e = 0xfe82, - dead_E = 0xfe83, - dead_i = 0xfe84, - dead_I = 0xfe85, - dead_o = 0xfe86, - dead_O = 0xfe87, - dead_u = 0xfe88, - dead_U = 0xfe89, - dead_small_schwa = 0xfe8a, - dead_capital_schwa = 0xfe8b, - dead_greek = 0xfe8c, - First_Virtual_Screen = 0xfed0, - Prev_Virtual_Screen = 0xfed1, - Next_Virtual_Screen = 0xfed2, - Last_Virtual_Screen = 0xfed4, - Terminate_Server = 0xfed5, - AccessX_Enable = 0xfe70, - AccessX_Feedback_Enable = 0xfe71, - RepeatKeys_Enable = 0xfe72, - SlowKeys_Enable = 0xfe73, - BounceKeys_Enable = 0xfe74, - StickyKeys_Enable = 0xfe75, - MouseKeys_Enable = 0xfe76, - MouseKeys_Accel_Enable = 0xfe77, - Overlay1_Enable = 0xfe78, - Overlay2_Enable = 0xfe79, - AudibleBell_Enable = 0xfe7a, - Pointer_Left = 0xfee0, - Pointer_Right = 0xfee1, - Pointer_Up = 0xfee2, - Pointer_Down = 0xfee3, - Pointer_UpLeft = 0xfee4, - Pointer_UpRight = 0xfee5, - Pointer_DownLeft = 0xfee6, - Pointer_DownRight = 0xfee7, - Pointer_Button_Dflt = 0xfee8, - Pointer_Button1 = 0xfee9, - Pointer_Button2 = 0xfeea, - Pointer_Button3 = 0xfeeb, - Pointer_Button4 = 0xfeec, - Pointer_Button5 = 0xfeed, - Pointer_DblClick_Dflt = 0xfeee, - Pointer_DblClick1 = 0xfeef, - Pointer_DblClick2 = 0xfef0, - Pointer_DblClick3 = 0xfef1, - Pointer_DblClick4 = 0xfef2, - Pointer_DblClick5 = 0xfef3, - Pointer_Drag_Dflt = 0xfef4, - Pointer_Drag1 = 0xfef5, - Pointer_Drag2 = 0xfef6, - Pointer_Drag3 = 0xfef7, - Pointer_Drag4 = 0xfef8, - Pointer_Drag5 = 0xfefd, - Pointer_EnableKeys = 0xfef9, - Pointer_Accelerate = 0xfefa, - Pointer_DfltBtnNext = 0xfefb, - Pointer_DfltBtnPrev = 0xfefc, - ch = 0xfea0, - Ch = 0xfea1, - CH = 0xfea2, - c_h = 0xfea3, - C_h = 0xfea4, - C_H = 0xfea5, - key_3270_Duplicate = 0xfd01, - key_3270_FieldMark = 0xfd02, - key_3270_Right2 = 0xfd03, - key_3270_Left2 = 0xfd04, - key_3270_BackTab = 0xfd05, - key_3270_EraseEOF = 0xfd06, - key_3270_EraseInput = 0xfd07, - key_3270_Reset = 0xfd08, - key_3270_Quit = 0xfd09, - key_3270_PA1 = 0xfd0a, - key_3270_PA2 = 0xfd0b, - key_3270_PA3 = 0xfd0c, - key_3270_Test = 0xfd0d, - key_3270_Attn = 0xfd0e, - key_3270_CursorBlink = 0xfd0f, - key_3270_AltCursor = 0xfd10, - key_3270_KeyClick = 0xfd11, - key_3270_Jump = 0xfd12, - key_3270_Ident = 0xfd13, - key_3270_Rule = 0xfd14, - key_3270_Copy = 0xfd15, - key_3270_Play = 0xfd16, - key_3270_Setup = 0xfd17, - key_3270_Record = 0xfd18, - key_3270_ChangeScreen = 0xfd19, - key_3270_DeleteWord = 0xfd1a, - key_3270_ExSelect = 0xfd1b, - key_3270_CursorSelect = 0xfd1c, - key_3270_PrintScreen = 0xfd1d, - key_3270_Enter = 0xfd1e, - space = 0x0020, - exclam = 0x0021, - quotedbl = 0x0022, - numbersign = 0x0023, - dollar = 0x0024, - percent = 0x0025, - ampersand = 0x0026, - apostrophe = 0x0027, - quoteright = 0x0027, - parenleft = 0x0028, - parenright = 0x0029, - asterisk = 0x002a, - plus = 0x002b, - comma = 0x002c, - minus = 0x002d, - period = 0x002e, - slash = 0x002f, - key_0 = 0x0030, - key_1 = 0x0031, - key_2 = 0x0032, - key_3 = 0x0033, - key_4 = 0x0034, - key_5 = 0x0035, - key_6 = 0x0036, - key_7 = 0x0037, - key_8 = 0x0038, - key_9 = 0x0039, - colon = 0x003a, - semicolon = 0x003b, - less = 0x003c, - equal = 0x003d, - greater = 0x003e, - question = 0x003f, - at = 0x0040, - A = 0x0041, - B = 0x0042, - C = 0x0043, - D = 0x0044, - E = 0x0045, - F = 0x0046, - G = 0x0047, - H = 0x0048, - I = 0x0049, - J = 0x004a, - K = 0x004b, - L = 0x004c, - M = 0x004d, - N = 0x004e, - O = 0x004f, - P = 0x0050, - Q = 0x0051, - R = 0x0052, - S = 0x0053, - T = 0x0054, - U = 0x0055, - V = 0x0056, - W = 0x0057, - X = 0x0058, - Y = 0x0059, - Z = 0x005a, - bracketleft = 0x005b, - backslash = 0x005c, - bracketright = 0x005d, - asciicircum = 0x005e, - underscore = 0x005f, - grave = 0x0060, - quoteleft = 0x0060, - a = 0x0061, - b = 0x0062, - c = 0x0063, - d = 0x0064, - e = 0x0065, - f = 0x0066, - g = 0x0067, - h = 0x0068, - i = 0x0069, - j = 0x006a, - k = 0x006b, - l = 0x006c, - m = 0x006d, - n = 0x006e, - o = 0x006f, - p = 0x0070, - q = 0x0071, - r = 0x0072, - s = 0x0073, - t = 0x0074, - u = 0x0075, - v = 0x0076, - w = 0x0077, - x = 0x0078, - y = 0x0079, - z = 0x007a, - braceleft = 0x007b, - bar = 0x007c, - braceright = 0x007d, - asciitilde = 0x007e, - nobreakspace = 0x00a0, - exclamdown = 0x00a1, - cent = 0x00a2, - sterling = 0x00a3, - currency = 0x00a4, - yen = 0x00a5, - brokenbar = 0x00a6, - section = 0x00a7, - diaeresis = 0x00a8, - copyright = 0x00a9, - ordfeminine = 0x00aa, - guillemotleft = 0x00ab, - notsign = 0x00ac, - hyphen = 0x00ad, - registered = 0x00ae, - macron = 0x00af, - degree = 0x00b0, - plusminus = 0x00b1, - twosuperior = 0x00b2, - threesuperior = 0x00b3, - acute = 0x00b4, - mu = 0x00b5, - paragraph = 0x00b6, - periodcentered = 0x00b7, - cedilla = 0x00b8, - onesuperior = 0x00b9, - masculine = 0x00ba, - guillemotright = 0x00bb, - onequarter = 0x00bc, - onehalf = 0x00bd, - threequarters = 0x00be, - questiondown = 0x00bf, - Agrave = 0x00c0, - Aacute = 0x00c1, - Acircumflex = 0x00c2, - Atilde = 0x00c3, - Adiaeresis = 0x00c4, - Aring = 0x00c5, - AE = 0x00c6, - Ccedilla = 0x00c7, - Egrave = 0x00c8, - Eacute = 0x00c9, - Ecircumflex = 0x00ca, - Ediaeresis = 0x00cb, - Igrave = 0x00cc, - Iacute = 0x00cd, - Icircumflex = 0x00ce, - Idiaeresis = 0x00cf, - ETH = 0x00d0, - Eth = 0x00d0, - Ntilde = 0x00d1, - Ograve = 0x00d2, - Oacute = 0x00d3, - Ocircumflex = 0x00d4, - Otilde = 0x00d5, - Odiaeresis = 0x00d6, - multiply = 0x00d7, - Oslash = 0x00d8, - Ooblique = 0x00d8, - Ugrave = 0x00d9, - Uacute = 0x00da, - Ucircumflex = 0x00db, - Udiaeresis = 0x00dc, - Yacute = 0x00dd, - THORN = 0x00de, - Thorn = 0x00de, - ssharp = 0x00df, - agrave = 0x00e0, - aacute = 0x00e1, - acircumflex = 0x00e2, - atilde = 0x00e3, - adiaeresis = 0x00e4, - aring = 0x00e5, - ae = 0x00e6, - ccedilla = 0x00e7, - egrave = 0x00e8, - eacute = 0x00e9, - ecircumflex = 0x00ea, - ediaeresis = 0x00eb, - igrave = 0x00ec, - iacute = 0x00ed, - icircumflex = 0x00ee, - idiaeresis = 0x00ef, - eth = 0x00f0, - ntilde = 0x00f1, - ograve = 0x00f2, - oacute = 0x00f3, - ocircumflex = 0x00f4, - otilde = 0x00f5, - odiaeresis = 0x00f6, - division = 0x00f7, - oslash = 0x00f8, - ooblique = 0x00f8, - ugrave = 0x00f9, - uacute = 0x00fa, - ucircumflex = 0x00fb, - udiaeresis = 0x00fc, - yacute = 0x00fd, - thorn = 0x00fe, - ydiaeresis = 0x00ff, - Aogonek = 0x01a1, - breve = 0x01a2, - Lstroke = 0x01a3, - Lcaron = 0x01a5, - Sacute = 0x01a6, - Scaron = 0x01a9, - Scedilla = 0x01aa, - Tcaron = 0x01ab, - Zacute = 0x01ac, - Zcaron = 0x01ae, - Zabovedot = 0x01af, - aogonek = 0x01b1, - ogonek = 0x01b2, - lstroke = 0x01b3, - lcaron = 0x01b5, - sacute = 0x01b6, - caron = 0x01b7, - scaron = 0x01b9, - scedilla = 0x01ba, - tcaron = 0x01bb, - zacute = 0x01bc, - doubleacute = 0x01bd, - zcaron = 0x01be, - zabovedot = 0x01bf, - Racute = 0x01c0, - Abreve = 0x01c3, - Lacute = 0x01c5, - Cacute = 0x01c6, - Ccaron = 0x01c8, - Eogonek = 0x01ca, - Ecaron = 0x01cc, - Dcaron = 0x01cf, - Dstroke = 0x01d0, - Nacute = 0x01d1, - Ncaron = 0x01d2, - Odoubleacute = 0x01d5, - Rcaron = 0x01d8, - Uring = 0x01d9, - Udoubleacute = 0x01db, - Tcedilla = 0x01de, - racute = 0x01e0, - abreve = 0x01e3, - lacute = 0x01e5, - cacute = 0x01e6, - ccaron = 0x01e8, - eogonek = 0x01ea, - ecaron = 0x01ec, - dcaron = 0x01ef, - dstroke = 0x01f0, - nacute = 0x01f1, - ncaron = 0x01f2, - odoubleacute = 0x01f5, - rcaron = 0x01f8, - uring = 0x01f9, - udoubleacute = 0x01fb, - tcedilla = 0x01fe, - abovedot = 0x01ff, - Hstroke = 0x02a1, - Hcircumflex = 0x02a6, - Iabovedot = 0x02a9, - Gbreve = 0x02ab, - Jcircumflex = 0x02ac, - hstroke = 0x02b1, - hcircumflex = 0x02b6, - idotless = 0x02b9, - gbreve = 0x02bb, - jcircumflex = 0x02bc, - Cabovedot = 0x02c5, - Ccircumflex = 0x02c6, - Gabovedot = 0x02d5, - Gcircumflex = 0x02d8, - Ubreve = 0x02dd, - Scircumflex = 0x02de, - cabovedot = 0x02e5, - ccircumflex = 0x02e6, - gabovedot = 0x02f5, - gcircumflex = 0x02f8, - ubreve = 0x02fd, - scircumflex = 0x02fe, - kra = 0x03a2, - kappa = 0x03a2, - Rcedilla = 0x03a3, - Itilde = 0x03a5, - Lcedilla = 0x03a6, - Emacron = 0x03aa, - Gcedilla = 0x03ab, - Tslash = 0x03ac, - rcedilla = 0x03b3, - itilde = 0x03b5, - lcedilla = 0x03b6, - emacron = 0x03ba, - gcedilla = 0x03bb, - tslash = 0x03bc, - ENG = 0x03bd, - eng = 0x03bf, - Amacron = 0x03c0, - Iogonek = 0x03c7, - Eabovedot = 0x03cc, - Imacron = 0x03cf, - Ncedilla = 0x03d1, - Omacron = 0x03d2, - Kcedilla = 0x03d3, - Uogonek = 0x03d9, - Utilde = 0x03dd, - Umacron = 0x03de, - amacron = 0x03e0, - iogonek = 0x03e7, - eabovedot = 0x03ec, - imacron = 0x03ef, - ncedilla = 0x03f1, - omacron = 0x03f2, - kcedilla = 0x03f3, - uogonek = 0x03f9, - utilde = 0x03fd, - umacron = 0x03fe, - Wcircumflex = 0x1000174, - wcircumflex = 0x1000175, - Ycircumflex = 0x1000176, - ycircumflex = 0x1000177, - Babovedot = 0x1001e02, - babovedot = 0x1001e03, - Dabovedot = 0x1001e0a, - dabovedot = 0x1001e0b, - Fabovedot = 0x1001e1e, - fabovedot = 0x1001e1f, - Mabovedot = 0x1001e40, - mabovedot = 0x1001e41, - Pabovedot = 0x1001e56, - pabovedot = 0x1001e57, - Sabovedot = 0x1001e60, - sabovedot = 0x1001e61, - Tabovedot = 0x1001e6a, - tabovedot = 0x1001e6b, - Wgrave = 0x1001e80, - wgrave = 0x1001e81, - Wacute = 0x1001e82, - wacute = 0x1001e83, - Wdiaeresis = 0x1001e84, - wdiaeresis = 0x1001e85, - Ygrave = 0x1001ef2, - ygrave = 0x1001ef3, - OE = 0x13bc, - oe = 0x13bd, - Ydiaeresis = 0x13be, - overline = 0x047e, - kana_fullstop = 0x04a1, - kana_openingbracket = 0x04a2, - kana_closingbracket = 0x04a3, - kana_comma = 0x04a4, - kana_conjunctive = 0x04a5, - kana_middledot = 0x04a5, - kana_WO = 0x04a6, - kana_a = 0x04a7, - kana_i = 0x04a8, - kana_u = 0x04a9, - kana_e = 0x04aa, - kana_o = 0x04ab, - kana_ya = 0x04ac, - kana_yu = 0x04ad, - kana_yo = 0x04ae, - kana_tsu = 0x04af, - kana_tu = 0x04af, - prolongedsound = 0x04b0, - kana_A = 0x04b1, - kana_I = 0x04b2, - kana_U = 0x04b3, - kana_E = 0x04b4, - kana_O = 0x04b5, - kana_KA = 0x04b6, - kana_KI = 0x04b7, - kana_KU = 0x04b8, - kana_KE = 0x04b9, - kana_KO = 0x04ba, - kana_SA = 0x04bb, - kana_SHI = 0x04bc, - kana_SU = 0x04bd, - kana_SE = 0x04be, - kana_SO = 0x04bf, - kana_TA = 0x04c0, - kana_CHI = 0x04c1, - kana_TI = 0x04c1, - kana_TSU = 0x04c2, - kana_TU = 0x04c2, - kana_TE = 0x04c3, - kana_TO = 0x04c4, - kana_NA = 0x04c5, - kana_NI = 0x04c6, - kana_NU = 0x04c7, - kana_NE = 0x04c8, - kana_NO = 0x04c9, - kana_HA = 0x04ca, - kana_HI = 0x04cb, - kana_FU = 0x04cc, - kana_HU = 0x04cc, - kana_HE = 0x04cd, - kana_HO = 0x04ce, - kana_MA = 0x04cf, - kana_MI = 0x04d0, - kana_MU = 0x04d1, - kana_ME = 0x04d2, - kana_MO = 0x04d3, - kana_YA = 0x04d4, - kana_YU = 0x04d5, - kana_YO = 0x04d6, - kana_RA = 0x04d7, - kana_RI = 0x04d8, - kana_RU = 0x04d9, - kana_RE = 0x04da, - kana_RO = 0x04db, - kana_WA = 0x04dc, - kana_N = 0x04dd, - voicedsound = 0x04de, - semivoicedsound = 0x04df, - kana_switch = 0xff7e, - Farsi_0 = 0x10006f0, - Farsi_1 = 0x10006f1, - Farsi_2 = 0x10006f2, - Farsi_3 = 0x10006f3, - Farsi_4 = 0x10006f4, - Farsi_5 = 0x10006f5, - Farsi_6 = 0x10006f6, - Farsi_7 = 0x10006f7, - Farsi_8 = 0x10006f8, - Farsi_9 = 0x10006f9, - Arabic_percent = 0x100066a, - Arabic_superscript_alef = 0x1000670, - Arabic_tteh = 0x1000679, - Arabic_peh = 0x100067e, - Arabic_tcheh = 0x1000686, - Arabic_ddal = 0x1000688, - Arabic_rreh = 0x1000691, - Arabic_comma = 0x05ac, - Arabic_fullstop = 0x10006d4, - Arabic_0 = 0x1000660, - Arabic_1 = 0x1000661, - Arabic_2 = 0x1000662, - Arabic_3 = 0x1000663, - Arabic_4 = 0x1000664, - Arabic_5 = 0x1000665, - Arabic_6 = 0x1000666, - Arabic_7 = 0x1000667, - Arabic_8 = 0x1000668, - Arabic_9 = 0x1000669, - Arabic_semicolon = 0x05bb, - Arabic_question_mark = 0x05bf, - Arabic_hamza = 0x05c1, - Arabic_maddaonalef = 0x05c2, - Arabic_hamzaonalef = 0x05c3, - Arabic_hamzaonwaw = 0x05c4, - Arabic_hamzaunderalef = 0x05c5, - Arabic_hamzaonyeh = 0x05c6, - Arabic_alef = 0x05c7, - Arabic_beh = 0x05c8, - Arabic_tehmarbuta = 0x05c9, - Arabic_teh = 0x05ca, - Arabic_theh = 0x05cb, - Arabic_jeem = 0x05cc, - Arabic_hah = 0x05cd, - Arabic_khah = 0x05ce, - Arabic_dal = 0x05cf, - Arabic_thal = 0x05d0, - Arabic_ra = 0x05d1, - Arabic_zain = 0x05d2, - Arabic_seen = 0x05d3, - Arabic_sheen = 0x05d4, - Arabic_sad = 0x05d5, - Arabic_dad = 0x05d6, - Arabic_tah = 0x05d7, - Arabic_zah = 0x05d8, - Arabic_ain = 0x05d9, - Arabic_ghain = 0x05da, - Arabic_tatweel = 0x05e0, - Arabic_feh = 0x05e1, - Arabic_qaf = 0x05e2, - Arabic_kaf = 0x05e3, - Arabic_lam = 0x05e4, - Arabic_meem = 0x05e5, - Arabic_noon = 0x05e6, - Arabic_ha = 0x05e7, - Arabic_heh = 0x05e7, - Arabic_waw = 0x05e8, - Arabic_alefmaksura = 0x05e9, - Arabic_yeh = 0x05ea, - Arabic_fathatan = 0x05eb, - Arabic_dammatan = 0x05ec, - Arabic_kasratan = 0x05ed, - Arabic_fatha = 0x05ee, - Arabic_damma = 0x05ef, - Arabic_kasra = 0x05f0, - Arabic_shadda = 0x05f1, - Arabic_sukun = 0x05f2, - Arabic_madda_above = 0x1000653, - Arabic_hamza_above = 0x1000654, - Arabic_hamza_below = 0x1000655, - Arabic_jeh = 0x1000698, - Arabic_veh = 0x10006a4, - Arabic_keheh = 0x10006a9, - Arabic_gaf = 0x10006af, - Arabic_noon_ghunna = 0x10006ba, - Arabic_heh_doachashmee = 0x10006be, - Farsi_yeh = 0x10006cc, - Arabic_farsi_yeh = 0x10006cc, - Arabic_yeh_baree = 0x10006d2, - Arabic_heh_goal = 0x10006c1, - Arabic_switch = 0xff7e, - Cyrillic_GHE_bar = 0x1000492, - Cyrillic_ghe_bar = 0x1000493, - Cyrillic_ZHE_descender = 0x1000496, - Cyrillic_zhe_descender = 0x1000497, - Cyrillic_KA_descender = 0x100049a, - Cyrillic_ka_descender = 0x100049b, - Cyrillic_KA_vertstroke = 0x100049c, - Cyrillic_ka_vertstroke = 0x100049d, - Cyrillic_EN_descender = 0x10004a2, - Cyrillic_en_descender = 0x10004a3, - Cyrillic_U_straight = 0x10004ae, - Cyrillic_u_straight = 0x10004af, - Cyrillic_U_straight_bar = 0x10004b0, - Cyrillic_u_straight_bar = 0x10004b1, - Cyrillic_HA_descender = 0x10004b2, - Cyrillic_ha_descender = 0x10004b3, - Cyrillic_CHE_descender = 0x10004b6, - Cyrillic_che_descender = 0x10004b7, - Cyrillic_CHE_vertstroke = 0x10004b8, - Cyrillic_che_vertstroke = 0x10004b9, - Cyrillic_SHHA = 0x10004ba, - Cyrillic_shha = 0x10004bb, - Cyrillic_SCHWA = 0x10004d8, - Cyrillic_schwa = 0x10004d9, - Cyrillic_I_macron = 0x10004e2, - Cyrillic_i_macron = 0x10004e3, - Cyrillic_O_bar = 0x10004e8, - Cyrillic_o_bar = 0x10004e9, - Cyrillic_U_macron = 0x10004ee, - Cyrillic_u_macron = 0x10004ef, - Serbian_dje = 0x06a1, - Macedonia_gje = 0x06a2, - Cyrillic_io = 0x06a3, - Ukrainian_ie = 0x06a4, - Ukranian_je = 0x06a4, - Macedonia_dse = 0x06a5, - Ukrainian_i = 0x06a6, - Ukranian_i = 0x06a6, - Ukrainian_yi = 0x06a7, - Ukranian_yi = 0x06a7, - Cyrillic_je = 0x06a8, - Serbian_je = 0x06a8, - Cyrillic_lje = 0x06a9, - Serbian_lje = 0x06a9, - Cyrillic_nje = 0x06aa, - Serbian_nje = 0x06aa, - Serbian_tshe = 0x06ab, - Macedonia_kje = 0x06ac, - Ukrainian_ghe_with_upturn = 0x06ad, - Byelorussian_shortu = 0x06ae, - Cyrillic_dzhe = 0x06af, - Serbian_dze = 0x06af, - numerosign = 0x06b0, - Serbian_DJE = 0x06b1, - Macedonia_GJE = 0x06b2, - Cyrillic_IO = 0x06b3, - Ukrainian_IE = 0x06b4, - Ukranian_JE = 0x06b4, - Macedonia_DSE = 0x06b5, - Ukrainian_I = 0x06b6, - Ukranian_I = 0x06b6, - Ukrainian_YI = 0x06b7, - Ukranian_YI = 0x06b7, - Cyrillic_JE = 0x06b8, - Serbian_JE = 0x06b8, - Cyrillic_LJE = 0x06b9, - Serbian_LJE = 0x06b9, - Cyrillic_NJE = 0x06ba, - Serbian_NJE = 0x06ba, - Serbian_TSHE = 0x06bb, - Macedonia_KJE = 0x06bc, - Ukrainian_GHE_WITH_UPTURN = 0x06bd, - Byelorussian_SHORTU = 0x06be, - Cyrillic_DZHE = 0x06bf, - Serbian_DZE = 0x06bf, - Cyrillic_yu = 0x06c0, - Cyrillic_a = 0x06c1, - Cyrillic_be = 0x06c2, - Cyrillic_tse = 0x06c3, - Cyrillic_de = 0x06c4, - Cyrillic_ie = 0x06c5, - Cyrillic_ef = 0x06c6, - Cyrillic_ghe = 0x06c7, - Cyrillic_ha = 0x06c8, - Cyrillic_i = 0x06c9, - Cyrillic_shorti = 0x06ca, - Cyrillic_ka = 0x06cb, - Cyrillic_el = 0x06cc, - Cyrillic_em = 0x06cd, - Cyrillic_en = 0x06ce, - Cyrillic_o = 0x06cf, - Cyrillic_pe = 0x06d0, - Cyrillic_ya = 0x06d1, - Cyrillic_er = 0x06d2, - Cyrillic_es = 0x06d3, - Cyrillic_te = 0x06d4, - Cyrillic_u = 0x06d5, - Cyrillic_zhe = 0x06d6, - Cyrillic_ve = 0x06d7, - Cyrillic_softsign = 0x06d8, - Cyrillic_yeru = 0x06d9, - Cyrillic_ze = 0x06da, - Cyrillic_sha = 0x06db, - Cyrillic_e = 0x06dc, - Cyrillic_shcha = 0x06dd, - Cyrillic_che = 0x06de, - Cyrillic_hardsign = 0x06df, - Cyrillic_YU = 0x06e0, - Cyrillic_A = 0x06e1, - Cyrillic_BE = 0x06e2, - Cyrillic_TSE = 0x06e3, - Cyrillic_DE = 0x06e4, - Cyrillic_IE = 0x06e5, - Cyrillic_EF = 0x06e6, - Cyrillic_GHE = 0x06e7, - Cyrillic_HA = 0x06e8, - Cyrillic_I = 0x06e9, - Cyrillic_SHORTI = 0x06ea, - Cyrillic_KA = 0x06eb, - Cyrillic_EL = 0x06ec, - Cyrillic_EM = 0x06ed, - Cyrillic_EN = 0x06ee, - Cyrillic_O = 0x06ef, - Cyrillic_PE = 0x06f0, - Cyrillic_YA = 0x06f1, - Cyrillic_ER = 0x06f2, - Cyrillic_ES = 0x06f3, - Cyrillic_TE = 0x06f4, - Cyrillic_U = 0x06f5, - Cyrillic_ZHE = 0x06f6, - Cyrillic_VE = 0x06f7, - Cyrillic_SOFTSIGN = 0x06f8, - Cyrillic_YERU = 0x06f9, - Cyrillic_ZE = 0x06fa, - Cyrillic_SHA = 0x06fb, - Cyrillic_E = 0x06fc, - Cyrillic_SHCHA = 0x06fd, - Cyrillic_CHE = 0x06fe, - Cyrillic_HARDSIGN = 0x06ff, - Greek_ALPHAaccent = 0x07a1, - Greek_EPSILONaccent = 0x07a2, - Greek_ETAaccent = 0x07a3, - Greek_IOTAaccent = 0x07a4, - Greek_IOTAdieresis = 0x07a5, - Greek_IOTAdiaeresis = 0x07a5, - Greek_OMICRONaccent = 0x07a7, - Greek_UPSILONaccent = 0x07a8, - Greek_UPSILONdieresis = 0x07a9, - Greek_OMEGAaccent = 0x07ab, - Greek_accentdieresis = 0x07ae, - Greek_horizbar = 0x07af, - Greek_alphaaccent = 0x07b1, - Greek_epsilonaccent = 0x07b2, - Greek_etaaccent = 0x07b3, - Greek_iotaaccent = 0x07b4, - Greek_iotadieresis = 0x07b5, - Greek_iotaaccentdieresis = 0x07b6, - Greek_omicronaccent = 0x07b7, - Greek_upsilonaccent = 0x07b8, - Greek_upsilondieresis = 0x07b9, - Greek_upsilonaccentdieresis = 0x07ba, - Greek_omegaaccent = 0x07bb, - Greek_ALPHA = 0x07c1, - Greek_BETA = 0x07c2, - Greek_GAMMA = 0x07c3, - Greek_DELTA = 0x07c4, - Greek_EPSILON = 0x07c5, - Greek_ZETA = 0x07c6, - Greek_ETA = 0x07c7, - Greek_THETA = 0x07c8, - Greek_IOTA = 0x07c9, - Greek_KAPPA = 0x07ca, - Greek_LAMDA = 0x07cb, - Greek_LAMBDA = 0x07cb, - Greek_MU = 0x07cc, - Greek_NU = 0x07cd, - Greek_XI = 0x07ce, - Greek_OMICRON = 0x07cf, - Greek_PI = 0x07d0, - Greek_RHO = 0x07d1, - Greek_SIGMA = 0x07d2, - Greek_TAU = 0x07d4, - Greek_UPSILON = 0x07d5, - Greek_PHI = 0x07d6, - Greek_CHI = 0x07d7, - Greek_PSI = 0x07d8, - Greek_OMEGA = 0x07d9, - Greek_alpha = 0x07e1, - Greek_beta = 0x07e2, - Greek_gamma = 0x07e3, - Greek_delta = 0x07e4, - Greek_epsilon = 0x07e5, - Greek_zeta = 0x07e6, - Greek_eta = 0x07e7, - Greek_theta = 0x07e8, - Greek_iota = 0x07e9, - Greek_kappa = 0x07ea, - Greek_lamda = 0x07eb, - Greek_lambda = 0x07eb, - Greek_mu = 0x07ec, - Greek_nu = 0x07ed, - Greek_xi = 0x07ee, - Greek_omicron = 0x07ef, - Greek_pi = 0x07f0, - Greek_rho = 0x07f1, - Greek_sigma = 0x07f2, - Greek_finalsmallsigma = 0x07f3, - Greek_tau = 0x07f4, - Greek_upsilon = 0x07f5, - Greek_phi = 0x07f6, - Greek_chi = 0x07f7, - Greek_psi = 0x07f8, - Greek_omega = 0x07f9, - Greek_switch = 0xff7e, - leftradical = 0x08a1, - topleftradical = 0x08a2, - horizconnector = 0x08a3, - topintegral = 0x08a4, - botintegral = 0x08a5, - vertconnector = 0x08a6, - topleftsqbracket = 0x08a7, - botleftsqbracket = 0x08a8, - toprightsqbracket = 0x08a9, - botrightsqbracket = 0x08aa, - topleftparens = 0x08ab, - botleftparens = 0x08ac, - toprightparens = 0x08ad, - botrightparens = 0x08ae, - leftmiddlecurlybrace = 0x08af, - rightmiddlecurlybrace = 0x08b0, - topleftsummation = 0x08b1, - botleftsummation = 0x08b2, - topvertsummationconnector = 0x08b3, - botvertsummationconnector = 0x08b4, - toprightsummation = 0x08b5, - botrightsummation = 0x08b6, - rightmiddlesummation = 0x08b7, - lessthanequal = 0x08bc, - notequal = 0x08bd, - greaterthanequal = 0x08be, - integral = 0x08bf, - therefore = 0x08c0, - variation = 0x08c1, - infinity = 0x08c2, - nabla = 0x08c5, - approximate = 0x08c8, - similarequal = 0x08c9, - ifonlyif = 0x08cd, - implies = 0x08ce, - identical = 0x08cf, - radical = 0x08d6, - includedin = 0x08da, - includes = 0x08db, - intersection = 0x08dc, - union = 0x08dd, - logicaland = 0x08de, - logicalor = 0x08df, - partialderivative = 0x08ef, - function = 0x08f6, - leftarrow = 0x08fb, - uparrow = 0x08fc, - rightarrow = 0x08fd, - downarrow = 0x08fe, - blank = 0x09df, - soliddiamond = 0x09e0, - checkerboard = 0x09e1, - ht = 0x09e2, - ff = 0x09e3, - cr = 0x09e4, - lf = 0x09e5, - nl = 0x09e8, - vt = 0x09e9, - lowrightcorner = 0x09ea, - uprightcorner = 0x09eb, - upleftcorner = 0x09ec, - lowleftcorner = 0x09ed, - crossinglines = 0x09ee, - horizlinescan1 = 0x09ef, - horizlinescan3 = 0x09f0, - horizlinescan5 = 0x09f1, - horizlinescan7 = 0x09f2, - horizlinescan9 = 0x09f3, - leftt = 0x09f4, - rightt = 0x09f5, - bott = 0x09f6, - topt = 0x09f7, - vertbar = 0x09f8, - emspace = 0x0aa1, - enspace = 0x0aa2, - em3space = 0x0aa3, - em4space = 0x0aa4, - digitspace = 0x0aa5, - punctspace = 0x0aa6, - thinspace = 0x0aa7, - hairspace = 0x0aa8, - emdash = 0x0aa9, - endash = 0x0aaa, - signifblank = 0x0aac, - ellipsis = 0x0aae, - doubbaselinedot = 0x0aaf, - onethird = 0x0ab0, - twothirds = 0x0ab1, - onefifth = 0x0ab2, - twofifths = 0x0ab3, - threefifths = 0x0ab4, - fourfifths = 0x0ab5, - onesixth = 0x0ab6, - fivesixths = 0x0ab7, - careof = 0x0ab8, - figdash = 0x0abb, - leftanglebracket = 0x0abc, - decimalpoint = 0x0abd, - rightanglebracket = 0x0abe, - marker = 0x0abf, - oneeighth = 0x0ac3, - threeeighths = 0x0ac4, - fiveeighths = 0x0ac5, - seveneighths = 0x0ac6, - trademark = 0x0ac9, - signaturemark = 0x0aca, - trademarkincircle = 0x0acb, - leftopentriangle = 0x0acc, - rightopentriangle = 0x0acd, - emopencircle = 0x0ace, - emopenrectangle = 0x0acf, - leftsinglequotemark = 0x0ad0, - rightsinglequotemark = 0x0ad1, - leftdoublequotemark = 0x0ad2, - rightdoublequotemark = 0x0ad3, - prescription = 0x0ad4, - permille = 0x0ad5, - minutes = 0x0ad6, - seconds = 0x0ad7, - latincross = 0x0ad9, - hexagram = 0x0ada, - filledrectbullet = 0x0adb, - filledlefttribullet = 0x0adc, - filledrighttribullet = 0x0add, - emfilledcircle = 0x0ade, - emfilledrect = 0x0adf, - enopencircbullet = 0x0ae0, - enopensquarebullet = 0x0ae1, - openrectbullet = 0x0ae2, - opentribulletup = 0x0ae3, - opentribulletdown = 0x0ae4, - openstar = 0x0ae5, - enfilledcircbullet = 0x0ae6, - enfilledsqbullet = 0x0ae7, - filledtribulletup = 0x0ae8, - filledtribulletdown = 0x0ae9, - leftpointer = 0x0aea, - rightpointer = 0x0aeb, - club = 0x0aec, - diamond = 0x0aed, - heart = 0x0aee, - maltesecross = 0x0af0, - dagger = 0x0af1, - doubledagger = 0x0af2, - checkmark = 0x0af3, - ballotcross = 0x0af4, - musicalsharp = 0x0af5, - musicalflat = 0x0af6, - malesymbol = 0x0af7, - femalesymbol = 0x0af8, - telephone = 0x0af9, - telephonerecorder = 0x0afa, - phonographcopyright = 0x0afb, - caret = 0x0afc, - singlelowquotemark = 0x0afd, - doublelowquotemark = 0x0afe, - cursor = 0x0aff, - leftcaret = 0x0ba3, - rightcaret = 0x0ba6, - downcaret = 0x0ba8, - upcaret = 0x0ba9, - overbar = 0x0bc0, - downtack = 0x0bc2, - upshoe = 0x0bc3, - downstile = 0x0bc4, - underbar = 0x0bc6, - jot = 0x0bca, - quad = 0x0bcc, - uptack = 0x0bce, - circle = 0x0bcf, - upstile = 0x0bd3, - downshoe = 0x0bd6, - rightshoe = 0x0bd8, - leftshoe = 0x0bda, - lefttack = 0x0bdc, - righttack = 0x0bfc, - hebrew_doublelowline = 0x0cdf, - hebrew_aleph = 0x0ce0, - hebrew_bet = 0x0ce1, - hebrew_beth = 0x0ce1, - hebrew_gimel = 0x0ce2, - hebrew_gimmel = 0x0ce2, - hebrew_dalet = 0x0ce3, - hebrew_daleth = 0x0ce3, - hebrew_he = 0x0ce4, - hebrew_waw = 0x0ce5, - hebrew_zain = 0x0ce6, - hebrew_zayin = 0x0ce6, - hebrew_chet = 0x0ce7, - hebrew_het = 0x0ce7, - hebrew_tet = 0x0ce8, - hebrew_teth = 0x0ce8, - hebrew_yod = 0x0ce9, - hebrew_finalkaph = 0x0cea, - hebrew_kaph = 0x0ceb, - hebrew_lamed = 0x0cec, - hebrew_finalmem = 0x0ced, - hebrew_mem = 0x0cee, - hebrew_finalnun = 0x0cef, - hebrew_nun = 0x0cf0, - hebrew_samech = 0x0cf1, - hebrew_samekh = 0x0cf1, - hebrew_ayin = 0x0cf2, - hebrew_finalpe = 0x0cf3, - hebrew_pe = 0x0cf4, - hebrew_finalzade = 0x0cf5, - hebrew_finalzadi = 0x0cf5, - hebrew_zade = 0x0cf6, - hebrew_zadi = 0x0cf6, - hebrew_qoph = 0x0cf7, - hebrew_kuf = 0x0cf7, - hebrew_resh = 0x0cf8, - hebrew_shin = 0x0cf9, - hebrew_taw = 0x0cfa, - hebrew_taf = 0x0cfa, - Hebrew_switch = 0xff7e, - Thai_kokai = 0x0da1, - Thai_khokhai = 0x0da2, - Thai_khokhuat = 0x0da3, - Thai_khokhwai = 0x0da4, - Thai_khokhon = 0x0da5, - Thai_khorakhang = 0x0da6, - Thai_ngongu = 0x0da7, - Thai_chochan = 0x0da8, - Thai_choching = 0x0da9, - Thai_chochang = 0x0daa, - Thai_soso = 0x0dab, - Thai_chochoe = 0x0dac, - Thai_yoying = 0x0dad, - Thai_dochada = 0x0dae, - Thai_topatak = 0x0daf, - Thai_thothan = 0x0db0, - Thai_thonangmontho = 0x0db1, - Thai_thophuthao = 0x0db2, - Thai_nonen = 0x0db3, - Thai_dodek = 0x0db4, - Thai_totao = 0x0db5, - Thai_thothung = 0x0db6, - Thai_thothahan = 0x0db7, - Thai_thothong = 0x0db8, - Thai_nonu = 0x0db9, - Thai_bobaimai = 0x0dba, - Thai_popla = 0x0dbb, - Thai_phophung = 0x0dbc, - Thai_fofa = 0x0dbd, - Thai_phophan = 0x0dbe, - Thai_fofan = 0x0dbf, - Thai_phosamphao = 0x0dc0, - Thai_moma = 0x0dc1, - Thai_yoyak = 0x0dc2, - Thai_rorua = 0x0dc3, - Thai_ru = 0x0dc4, - Thai_loling = 0x0dc5, - Thai_lu = 0x0dc6, - Thai_wowaen = 0x0dc7, - Thai_sosala = 0x0dc8, - Thai_sorusi = 0x0dc9, - Thai_sosua = 0x0dca, - Thai_hohip = 0x0dcb, - Thai_lochula = 0x0dcc, - Thai_oang = 0x0dcd, - Thai_honokhuk = 0x0dce, - Thai_paiyannoi = 0x0dcf, - Thai_saraa = 0x0dd0, - Thai_maihanakat = 0x0dd1, - Thai_saraaa = 0x0dd2, - Thai_saraam = 0x0dd3, - Thai_sarai = 0x0dd4, - Thai_saraii = 0x0dd5, - Thai_saraue = 0x0dd6, - Thai_sarauee = 0x0dd7, - Thai_sarau = 0x0dd8, - Thai_sarauu = 0x0dd9, - Thai_phinthu = 0x0dda, - Thai_maihanakat_maitho = 0x0dde, - Thai_baht = 0x0ddf, - Thai_sarae = 0x0de0, - Thai_saraae = 0x0de1, - Thai_sarao = 0x0de2, - Thai_saraaimaimuan = 0x0de3, - Thai_saraaimaimalai = 0x0de4, - Thai_lakkhangyao = 0x0de5, - Thai_maiyamok = 0x0de6, - Thai_maitaikhu = 0x0de7, - Thai_maiek = 0x0de8, - Thai_maitho = 0x0de9, - Thai_maitri = 0x0dea, - Thai_maichattawa = 0x0deb, - Thai_thanthakhat = 0x0dec, - Thai_nikhahit = 0x0ded, - Thai_leksun = 0x0df0, - Thai_leknung = 0x0df1, - Thai_leksong = 0x0df2, - Thai_leksam = 0x0df3, - Thai_leksi = 0x0df4, - Thai_lekha = 0x0df5, - Thai_lekhok = 0x0df6, - Thai_lekchet = 0x0df7, - Thai_lekpaet = 0x0df8, - Thai_lekkao = 0x0df9, - Hangul = 0xff31, - Hangul_Start = 0xff32, - Hangul_End = 0xff33, - Hangul_Hanja = 0xff34, - Hangul_Jamo = 0xff35, - Hangul_Romaja = 0xff36, - Hangul_Codeinput = 0xff37, - Hangul_Jeonja = 0xff38, - Hangul_Banja = 0xff39, - Hangul_PreHanja = 0xff3a, - Hangul_PostHanja = 0xff3b, - Hangul_SingleCandidate = 0xff3c, - Hangul_MultipleCandidate = 0xff3d, - Hangul_PreviousCandidate = 0xff3e, - Hangul_Special = 0xff3f, - Hangul_switch = 0xff7e, - Hangul_Kiyeog = 0x0ea1, - Hangul_SsangKiyeog = 0x0ea2, - Hangul_KiyeogSios = 0x0ea3, - Hangul_Nieun = 0x0ea4, - Hangul_NieunJieuj = 0x0ea5, - Hangul_NieunHieuh = 0x0ea6, - Hangul_Dikeud = 0x0ea7, - Hangul_SsangDikeud = 0x0ea8, - Hangul_Rieul = 0x0ea9, - Hangul_RieulKiyeog = 0x0eaa, - Hangul_RieulMieum = 0x0eab, - Hangul_RieulPieub = 0x0eac, - Hangul_RieulSios = 0x0ead, - Hangul_RieulTieut = 0x0eae, - Hangul_RieulPhieuf = 0x0eaf, - Hangul_RieulHieuh = 0x0eb0, - Hangul_Mieum = 0x0eb1, - Hangul_Pieub = 0x0eb2, - Hangul_SsangPieub = 0x0eb3, - Hangul_PieubSios = 0x0eb4, - Hangul_Sios = 0x0eb5, - Hangul_SsangSios = 0x0eb6, - Hangul_Ieung = 0x0eb7, - Hangul_Jieuj = 0x0eb8, - Hangul_SsangJieuj = 0x0eb9, - Hangul_Cieuc = 0x0eba, - Hangul_Khieuq = 0x0ebb, - Hangul_Tieut = 0x0ebc, - Hangul_Phieuf = 0x0ebd, - Hangul_Hieuh = 0x0ebe, - Hangul_A = 0x0ebf, - Hangul_AE = 0x0ec0, - Hangul_YA = 0x0ec1, - Hangul_YAE = 0x0ec2, - Hangul_EO = 0x0ec3, - Hangul_E = 0x0ec4, - Hangul_YEO = 0x0ec5, - Hangul_YE = 0x0ec6, - Hangul_O = 0x0ec7, - Hangul_WA = 0x0ec8, - Hangul_WAE = 0x0ec9, - Hangul_OE = 0x0eca, - Hangul_YO = 0x0ecb, - Hangul_U = 0x0ecc, - Hangul_WEO = 0x0ecd, - Hangul_WE = 0x0ece, - Hangul_WI = 0x0ecf, - Hangul_YU = 0x0ed0, - Hangul_EU = 0x0ed1, - Hangul_YI = 0x0ed2, - Hangul_I = 0x0ed3, - Hangul_J_Kiyeog = 0x0ed4, - Hangul_J_SsangKiyeog = 0x0ed5, - Hangul_J_KiyeogSios = 0x0ed6, - Hangul_J_Nieun = 0x0ed7, - Hangul_J_NieunJieuj = 0x0ed8, - Hangul_J_NieunHieuh = 0x0ed9, - Hangul_J_Dikeud = 0x0eda, - Hangul_J_Rieul = 0x0edb, - Hangul_J_RieulKiyeog = 0x0edc, - Hangul_J_RieulMieum = 0x0edd, - Hangul_J_RieulPieub = 0x0ede, - Hangul_J_RieulSios = 0x0edf, - Hangul_J_RieulTieut = 0x0ee0, - Hangul_J_RieulPhieuf = 0x0ee1, - Hangul_J_RieulHieuh = 0x0ee2, - Hangul_J_Mieum = 0x0ee3, - Hangul_J_Pieub = 0x0ee4, - Hangul_J_PieubSios = 0x0ee5, - Hangul_J_Sios = 0x0ee6, - Hangul_J_SsangSios = 0x0ee7, - Hangul_J_Ieung = 0x0ee8, - Hangul_J_Jieuj = 0x0ee9, - Hangul_J_Cieuc = 0x0eea, - Hangul_J_Khieuq = 0x0eeb, - Hangul_J_Tieut = 0x0eec, - Hangul_J_Phieuf = 0x0eed, - Hangul_J_Hieuh = 0x0eee, - Hangul_RieulYeorinHieuh = 0x0eef, - Hangul_SunkyeongeumMieum = 0x0ef0, - Hangul_SunkyeongeumPieub = 0x0ef1, - Hangul_PanSios = 0x0ef2, - Hangul_KkogjiDalrinIeung = 0x0ef3, - Hangul_SunkyeongeumPhieuf = 0x0ef4, - Hangul_YeorinHieuh = 0x0ef5, - Hangul_AraeA = 0x0ef6, - Hangul_AraeAE = 0x0ef7, - Hangul_J_PanSios = 0x0ef8, - Hangul_J_KkogjiDalrinIeung = 0x0ef9, - Hangul_J_YeorinHieuh = 0x0efa, - Korean_Won = 0x0eff, - Armenian_ligature_ew = 0x1000587, - Armenian_full_stop = 0x1000589, - Armenian_verjaket = 0x1000589, - Armenian_separation_mark = 0x100055d, - Armenian_but = 0x100055d, - Armenian_hyphen = 0x100058a, - Armenian_yentamna = 0x100058a, - Armenian_exclam = 0x100055c, - Armenian_amanak = 0x100055c, - Armenian_accent = 0x100055b, - Armenian_shesht = 0x100055b, - Armenian_question = 0x100055e, - Armenian_paruyk = 0x100055e, - Armenian_AYB = 0x1000531, - Armenian_ayb = 0x1000561, - Armenian_BEN = 0x1000532, - Armenian_ben = 0x1000562, - Armenian_GIM = 0x1000533, - Armenian_gim = 0x1000563, - Armenian_DA = 0x1000534, - Armenian_da = 0x1000564, - Armenian_YECH = 0x1000535, - Armenian_yech = 0x1000565, - Armenian_ZA = 0x1000536, - Armenian_za = 0x1000566, - Armenian_E = 0x1000537, - Armenian_e = 0x1000567, - Armenian_AT = 0x1000538, - Armenian_at = 0x1000568, - Armenian_TO = 0x1000539, - Armenian_to = 0x1000569, - Armenian_ZHE = 0x100053a, - Armenian_zhe = 0x100056a, - Armenian_INI = 0x100053b, - Armenian_ini = 0x100056b, - Armenian_LYUN = 0x100053c, - Armenian_lyun = 0x100056c, - Armenian_KHE = 0x100053d, - Armenian_khe = 0x100056d, - Armenian_TSA = 0x100053e, - Armenian_tsa = 0x100056e, - Armenian_KEN = 0x100053f, - Armenian_ken = 0x100056f, - Armenian_HO = 0x1000540, - Armenian_ho = 0x1000570, - Armenian_DZA = 0x1000541, - Armenian_dza = 0x1000571, - Armenian_GHAT = 0x1000542, - Armenian_ghat = 0x1000572, - Armenian_TCHE = 0x1000543, - Armenian_tche = 0x1000573, - Armenian_MEN = 0x1000544, - Armenian_men = 0x1000574, - Armenian_HI = 0x1000545, - Armenian_hi = 0x1000575, - Armenian_NU = 0x1000546, - Armenian_nu = 0x1000576, - Armenian_SHA = 0x1000547, - Armenian_sha = 0x1000577, - Armenian_VO = 0x1000548, - Armenian_vo = 0x1000578, - Armenian_CHA = 0x1000549, - Armenian_cha = 0x1000579, - Armenian_PE = 0x100054a, - Armenian_pe = 0x100057a, - Armenian_JE = 0x100054b, - Armenian_je = 0x100057b, - Armenian_RA = 0x100054c, - Armenian_ra = 0x100057c, - Armenian_SE = 0x100054d, - Armenian_se = 0x100057d, - Armenian_VEV = 0x100054e, - Armenian_vev = 0x100057e, - Armenian_TYUN = 0x100054f, - Armenian_tyun = 0x100057f, - Armenian_RE = 0x1000550, - Armenian_re = 0x1000580, - Armenian_TSO = 0x1000551, - Armenian_tso = 0x1000581, - Armenian_VYUN = 0x1000552, - Armenian_vyun = 0x1000582, - Armenian_PYUR = 0x1000553, - Armenian_pyur = 0x1000583, - Armenian_KE = 0x1000554, - Armenian_ke = 0x1000584, - Armenian_O = 0x1000555, - Armenian_o = 0x1000585, - Armenian_FE = 0x1000556, - Armenian_fe = 0x1000586, - Armenian_apostrophe = 0x100055a, - Georgian_an = 0x10010d0, - Georgian_ban = 0x10010d1, - Georgian_gan = 0x10010d2, - Georgian_don = 0x10010d3, - Georgian_en = 0x10010d4, - Georgian_vin = 0x10010d5, - Georgian_zen = 0x10010d6, - Georgian_tan = 0x10010d7, - Georgian_in = 0x10010d8, - Georgian_kan = 0x10010d9, - Georgian_las = 0x10010da, - Georgian_man = 0x10010db, - Georgian_nar = 0x10010dc, - Georgian_on = 0x10010dd, - Georgian_par = 0x10010de, - Georgian_zhar = 0x10010df, - Georgian_rae = 0x10010e0, - Georgian_san = 0x10010e1, - Georgian_tar = 0x10010e2, - Georgian_un = 0x10010e3, - Georgian_phar = 0x10010e4, - Georgian_khar = 0x10010e5, - Georgian_ghan = 0x10010e6, - Georgian_qar = 0x10010e7, - Georgian_shin = 0x10010e8, - Georgian_chin = 0x10010e9, - Georgian_can = 0x10010ea, - Georgian_jil = 0x10010eb, - Georgian_cil = 0x10010ec, - Georgian_char = 0x10010ed, - Georgian_xan = 0x10010ee, - Georgian_jhan = 0x10010ef, - Georgian_hae = 0x10010f0, - Georgian_he = 0x10010f1, - Georgian_hie = 0x10010f2, - Georgian_we = 0x10010f3, - Georgian_har = 0x10010f4, - Georgian_hoe = 0x10010f5, - Georgian_fi = 0x10010f6, - Xabovedot = 0x1001e8a, - Ibreve = 0x100012c, - Zstroke = 0x10001b5, - Gcaron = 0x10001e6, - Ocaron = 0x10001d1, - Obarred = 0x100019f, - xabovedot = 0x1001e8b, - ibreve = 0x100012d, - zstroke = 0x10001b6, - gcaron = 0x10001e7, - ocaron = 0x10001d2, - obarred = 0x1000275, - SCHWA = 0x100018f, - schwa = 0x1000259, - EZH = 0x10001b7, - ezh = 0x1000292, - Lbelowdot = 0x1001e36, - lbelowdot = 0x1001e37, - Abelowdot = 0x1001ea0, - abelowdot = 0x1001ea1, - Ahook = 0x1001ea2, - ahook = 0x1001ea3, - Acircumflexacute = 0x1001ea4, - acircumflexacute = 0x1001ea5, - Acircumflexgrave = 0x1001ea6, - acircumflexgrave = 0x1001ea7, - Acircumflexhook = 0x1001ea8, - acircumflexhook = 0x1001ea9, - Acircumflextilde = 0x1001eaa, - acircumflextilde = 0x1001eab, - Acircumflexbelowdot = 0x1001eac, - acircumflexbelowdot = 0x1001ead, - Abreveacute = 0x1001eae, - abreveacute = 0x1001eaf, - Abrevegrave = 0x1001eb0, - abrevegrave = 0x1001eb1, - Abrevehook = 0x1001eb2, - abrevehook = 0x1001eb3, - Abrevetilde = 0x1001eb4, - abrevetilde = 0x1001eb5, - Abrevebelowdot = 0x1001eb6, - abrevebelowdot = 0x1001eb7, - Ebelowdot = 0x1001eb8, - ebelowdot = 0x1001eb9, - Ehook = 0x1001eba, - ehook = 0x1001ebb, - Etilde = 0x1001ebc, - etilde = 0x1001ebd, - Ecircumflexacute = 0x1001ebe, - ecircumflexacute = 0x1001ebf, - Ecircumflexgrave = 0x1001ec0, - ecircumflexgrave = 0x1001ec1, - Ecircumflexhook = 0x1001ec2, - ecircumflexhook = 0x1001ec3, - Ecircumflextilde = 0x1001ec4, - ecircumflextilde = 0x1001ec5, - Ecircumflexbelowdot = 0x1001ec6, - ecircumflexbelowdot = 0x1001ec7, - Ihook = 0x1001ec8, - ihook = 0x1001ec9, - Ibelowdot = 0x1001eca, - ibelowdot = 0x1001ecb, - Obelowdot = 0x1001ecc, - obelowdot = 0x1001ecd, - Ohook = 0x1001ece, - ohook = 0x1001ecf, - Ocircumflexacute = 0x1001ed0, - ocircumflexacute = 0x1001ed1, - Ocircumflexgrave = 0x1001ed2, - ocircumflexgrave = 0x1001ed3, - Ocircumflexhook = 0x1001ed4, - ocircumflexhook = 0x1001ed5, - Ocircumflextilde = 0x1001ed6, - ocircumflextilde = 0x1001ed7, - Ocircumflexbelowdot = 0x1001ed8, - ocircumflexbelowdot = 0x1001ed9, - Ohornacute = 0x1001eda, - ohornacute = 0x1001edb, - Ohorngrave = 0x1001edc, - ohorngrave = 0x1001edd, - Ohornhook = 0x1001ede, - ohornhook = 0x1001edf, - Ohorntilde = 0x1001ee0, - ohorntilde = 0x1001ee1, - Ohornbelowdot = 0x1001ee2, - ohornbelowdot = 0x1001ee3, - Ubelowdot = 0x1001ee4, - ubelowdot = 0x1001ee5, - Uhook = 0x1001ee6, - uhook = 0x1001ee7, - Uhornacute = 0x1001ee8, - uhornacute = 0x1001ee9, - Uhorngrave = 0x1001eea, - uhorngrave = 0x1001eeb, - Uhornhook = 0x1001eec, - uhornhook = 0x1001eed, - Uhorntilde = 0x1001eee, - uhorntilde = 0x1001eef, - Uhornbelowdot = 0x1001ef0, - uhornbelowdot = 0x1001ef1, - Ybelowdot = 0x1001ef4, - ybelowdot = 0x1001ef5, - Yhook = 0x1001ef6, - yhook = 0x1001ef7, - Ytilde = 0x1001ef8, - ytilde = 0x1001ef9, - Ohorn = 0x10001a0, - ohorn = 0x10001a1, - Uhorn = 0x10001af, - uhorn = 0x10001b0, - EcuSign = 0x10020a0, - ColonSign = 0x10020a1, - CruzeiroSign = 0x10020a2, - FFrancSign = 0x10020a3, - LiraSign = 0x10020a4, - MillSign = 0x10020a5, - NairaSign = 0x10020a6, - PesetaSign = 0x10020a7, - RupeeSign = 0x10020a8, - WonSign = 0x10020a9, - NewSheqelSign = 0x10020aa, - DongSign = 0x10020ab, - EuroSign = 0x20ac, - zerosuperior = 0x1002070, - foursuperior = 0x1002074, - fivesuperior = 0x1002075, - sixsuperior = 0x1002076, - sevensuperior = 0x1002077, - eightsuperior = 0x1002078, - ninesuperior = 0x1002079, - zerosubscript = 0x1002080, - onesubscript = 0x1002081, - twosubscript = 0x1002082, - threesubscript = 0x1002083, - foursubscript = 0x1002084, - fivesubscript = 0x1002085, - sixsubscript = 0x1002086, - sevensubscript = 0x1002087, - eightsubscript = 0x1002088, - ninesubscript = 0x1002089, - partdifferential = 0x1002202, - emptyset = 0x1002205, - elementof = 0x1002208, - notelementof = 0x1002209, - containsas = 0x100220B, - squareroot = 0x100221A, - cuberoot = 0x100221B, - fourthroot = 0x100221C, - dintegral = 0x100222C, - tintegral = 0x100222D, - because = 0x1002235, - approxeq = 0x1002248, - notapproxeq = 0x1002247, - notidentical = 0x1002262, - stricteq = 0x1002263, - braille_dot_1 = 0xfff1, - braille_dot_2 = 0xfff2, - braille_dot_3 = 0xfff3, - braille_dot_4 = 0xfff4, - braille_dot_5 = 0xfff5, - braille_dot_6 = 0xfff6, - braille_dot_7 = 0xfff7, - braille_dot_8 = 0xfff8, - braille_dot_9 = 0xfff9, - braille_dot_10 = 0xfffa, - braille_blank = 0x1002800, - braille_dots_1 = 0x1002801, - braille_dots_2 = 0x1002802, - braille_dots_12 = 0x1002803, - braille_dots_3 = 0x1002804, - braille_dots_13 = 0x1002805, - braille_dots_23 = 0x1002806, - braille_dots_123 = 0x1002807, - braille_dots_4 = 0x1002808, - braille_dots_14 = 0x1002809, - braille_dots_24 = 0x100280a, - braille_dots_124 = 0x100280b, - braille_dots_34 = 0x100280c, - braille_dots_134 = 0x100280d, - braille_dots_234 = 0x100280e, - braille_dots_1234 = 0x100280f, - braille_dots_5 = 0x1002810, - braille_dots_15 = 0x1002811, - braille_dots_25 = 0x1002812, - braille_dots_125 = 0x1002813, - braille_dots_35 = 0x1002814, - braille_dots_135 = 0x1002815, - braille_dots_235 = 0x1002816, - braille_dots_1235 = 0x1002817, - braille_dots_45 = 0x1002818, - braille_dots_145 = 0x1002819, - braille_dots_245 = 0x100281a, - braille_dots_1245 = 0x100281b, - braille_dots_345 = 0x100281c, - braille_dots_1345 = 0x100281d, - braille_dots_2345 = 0x100281e, - braille_dots_12345 = 0x100281f, - braille_dots_6 = 0x1002820, - braille_dots_16 = 0x1002821, - braille_dots_26 = 0x1002822, - braille_dots_126 = 0x1002823, - braille_dots_36 = 0x1002824, - braille_dots_136 = 0x1002825, - braille_dots_236 = 0x1002826, - braille_dots_1236 = 0x1002827, - braille_dots_46 = 0x1002828, - braille_dots_146 = 0x1002829, - braille_dots_246 = 0x100282a, - braille_dots_1246 = 0x100282b, - braille_dots_346 = 0x100282c, - braille_dots_1346 = 0x100282d, - braille_dots_2346 = 0x100282e, - braille_dots_12346 = 0x100282f, - braille_dots_56 = 0x1002830, - braille_dots_156 = 0x1002831, - braille_dots_256 = 0x1002832, - braille_dots_1256 = 0x1002833, - braille_dots_356 = 0x1002834, - braille_dots_1356 = 0x1002835, - braille_dots_2356 = 0x1002836, - braille_dots_12356 = 0x1002837, - braille_dots_456 = 0x1002838, - braille_dots_1456 = 0x1002839, - braille_dots_2456 = 0x100283a, - braille_dots_12456 = 0x100283b, - braille_dots_3456 = 0x100283c, - braille_dots_13456 = 0x100283d, - braille_dots_23456 = 0x100283e, - braille_dots_123456 = 0x100283f, - braille_dots_7 = 0x1002840, - braille_dots_17 = 0x1002841, - braille_dots_27 = 0x1002842, - braille_dots_127 = 0x1002843, - braille_dots_37 = 0x1002844, - braille_dots_137 = 0x1002845, - braille_dots_237 = 0x1002846, - braille_dots_1237 = 0x1002847, - braille_dots_47 = 0x1002848, - braille_dots_147 = 0x1002849, - braille_dots_247 = 0x100284a, - braille_dots_1247 = 0x100284b, - braille_dots_347 = 0x100284c, - braille_dots_1347 = 0x100284d, - braille_dots_2347 = 0x100284e, - braille_dots_12347 = 0x100284f, - braille_dots_57 = 0x1002850, - braille_dots_157 = 0x1002851, - braille_dots_257 = 0x1002852, - braille_dots_1257 = 0x1002853, - braille_dots_357 = 0x1002854, - braille_dots_1357 = 0x1002855, - braille_dots_2357 = 0x1002856, - braille_dots_12357 = 0x1002857, - braille_dots_457 = 0x1002858, - braille_dots_1457 = 0x1002859, - braille_dots_2457 = 0x100285a, - braille_dots_12457 = 0x100285b, - braille_dots_3457 = 0x100285c, - braille_dots_13457 = 0x100285d, - braille_dots_23457 = 0x100285e, - braille_dots_123457 = 0x100285f, - braille_dots_67 = 0x1002860, - braille_dots_167 = 0x1002861, - braille_dots_267 = 0x1002862, - braille_dots_1267 = 0x1002863, - braille_dots_367 = 0x1002864, - braille_dots_1367 = 0x1002865, - braille_dots_2367 = 0x1002866, - braille_dots_12367 = 0x1002867, - braille_dots_467 = 0x1002868, - braille_dots_1467 = 0x1002869, - braille_dots_2467 = 0x100286a, - braille_dots_12467 = 0x100286b, - braille_dots_3467 = 0x100286c, - braille_dots_13467 = 0x100286d, - braille_dots_23467 = 0x100286e, - braille_dots_123467 = 0x100286f, - braille_dots_567 = 0x1002870, - braille_dots_1567 = 0x1002871, - braille_dots_2567 = 0x1002872, - braille_dots_12567 = 0x1002873, - braille_dots_3567 = 0x1002874, - braille_dots_13567 = 0x1002875, - braille_dots_23567 = 0x1002876, - braille_dots_123567 = 0x1002877, - braille_dots_4567 = 0x1002878, - braille_dots_14567 = 0x1002879, - braille_dots_24567 = 0x100287a, - braille_dots_124567 = 0x100287b, - braille_dots_34567 = 0x100287c, - braille_dots_134567 = 0x100287d, - braille_dots_234567 = 0x100287e, - braille_dots_1234567 = 0x100287f, - braille_dots_8 = 0x1002880, - braille_dots_18 = 0x1002881, - braille_dots_28 = 0x1002882, - braille_dots_128 = 0x1002883, - braille_dots_38 = 0x1002884, - braille_dots_138 = 0x1002885, - braille_dots_238 = 0x1002886, - braille_dots_1238 = 0x1002887, - braille_dots_48 = 0x1002888, - braille_dots_148 = 0x1002889, - braille_dots_248 = 0x100288a, - braille_dots_1248 = 0x100288b, - braille_dots_348 = 0x100288c, - braille_dots_1348 = 0x100288d, - braille_dots_2348 = 0x100288e, - braille_dots_12348 = 0x100288f, - braille_dots_58 = 0x1002890, - braille_dots_158 = 0x1002891, - braille_dots_258 = 0x1002892, - braille_dots_1258 = 0x1002893, - braille_dots_358 = 0x1002894, - braille_dots_1358 = 0x1002895, - braille_dots_2358 = 0x1002896, - braille_dots_12358 = 0x1002897, - braille_dots_458 = 0x1002898, - braille_dots_1458 = 0x1002899, - braille_dots_2458 = 0x100289a, - braille_dots_12458 = 0x100289b, - braille_dots_3458 = 0x100289c, - braille_dots_13458 = 0x100289d, - braille_dots_23458 = 0x100289e, - braille_dots_123458 = 0x100289f, - braille_dots_68 = 0x10028a0, - braille_dots_168 = 0x10028a1, - braille_dots_268 = 0x10028a2, - braille_dots_1268 = 0x10028a3, - braille_dots_368 = 0x10028a4, - braille_dots_1368 = 0x10028a5, - braille_dots_2368 = 0x10028a6, - braille_dots_12368 = 0x10028a7, - braille_dots_468 = 0x10028a8, - braille_dots_1468 = 0x10028a9, - braille_dots_2468 = 0x10028aa, - braille_dots_12468 = 0x10028ab, - braille_dots_3468 = 0x10028ac, - braille_dots_13468 = 0x10028ad, - braille_dots_23468 = 0x10028ae, - braille_dots_123468 = 0x10028af, - braille_dots_568 = 0x10028b0, - braille_dots_1568 = 0x10028b1, - braille_dots_2568 = 0x10028b2, - braille_dots_12568 = 0x10028b3, - braille_dots_3568 = 0x10028b4, - braille_dots_13568 = 0x10028b5, - braille_dots_23568 = 0x10028b6, - braille_dots_123568 = 0x10028b7, - braille_dots_4568 = 0x10028b8, - braille_dots_14568 = 0x10028b9, - braille_dots_24568 = 0x10028ba, - braille_dots_124568 = 0x10028bb, - braille_dots_34568 = 0x10028bc, - braille_dots_134568 = 0x10028bd, - braille_dots_234568 = 0x10028be, - braille_dots_1234568 = 0x10028bf, - braille_dots_78 = 0x10028c0, - braille_dots_178 = 0x10028c1, - braille_dots_278 = 0x10028c2, - braille_dots_1278 = 0x10028c3, - braille_dots_378 = 0x10028c4, - braille_dots_1378 = 0x10028c5, - braille_dots_2378 = 0x10028c6, - braille_dots_12378 = 0x10028c7, - braille_dots_478 = 0x10028c8, - braille_dots_1478 = 0x10028c9, - braille_dots_2478 = 0x10028ca, - braille_dots_12478 = 0x10028cb, - braille_dots_3478 = 0x10028cc, - braille_dots_13478 = 0x10028cd, - braille_dots_23478 = 0x10028ce, - braille_dots_123478 = 0x10028cf, - braille_dots_578 = 0x10028d0, - braille_dots_1578 = 0x10028d1, - braille_dots_2578 = 0x10028d2, - braille_dots_12578 = 0x10028d3, - braille_dots_3578 = 0x10028d4, - braille_dots_13578 = 0x10028d5, - braille_dots_23578 = 0x10028d6, - braille_dots_123578 = 0x10028d7, - braille_dots_4578 = 0x10028d8, - braille_dots_14578 = 0x10028d9, - braille_dots_24578 = 0x10028da, - braille_dots_124578 = 0x10028db, - braille_dots_34578 = 0x10028dc, - braille_dots_134578 = 0x10028dd, - braille_dots_234578 = 0x10028de, - braille_dots_1234578 = 0x10028df, - braille_dots_678 = 0x10028e0, - braille_dots_1678 = 0x10028e1, - braille_dots_2678 = 0x10028e2, - braille_dots_12678 = 0x10028e3, - braille_dots_3678 = 0x10028e4, - braille_dots_13678 = 0x10028e5, - braille_dots_23678 = 0x10028e6, - braille_dots_123678 = 0x10028e7, - braille_dots_4678 = 0x10028e8, - braille_dots_14678 = 0x10028e9, - braille_dots_24678 = 0x10028ea, - braille_dots_124678 = 0x10028eb, - braille_dots_34678 = 0x10028ec, - braille_dots_134678 = 0x10028ed, - braille_dots_234678 = 0x10028ee, - braille_dots_1234678 = 0x10028ef, - braille_dots_5678 = 0x10028f0, - braille_dots_15678 = 0x10028f1, - braille_dots_25678 = 0x10028f2, - braille_dots_125678 = 0x10028f3, - braille_dots_35678 = 0x10028f4, - braille_dots_135678 = 0x10028f5, - braille_dots_235678 = 0x10028f6, - braille_dots_1235678 = 0x10028f7, - braille_dots_45678 = 0x10028f8, - braille_dots_145678 = 0x10028f9, - braille_dots_245678 = 0x10028fa, - braille_dots_1245678 = 0x10028fb, - braille_dots_345678 = 0x10028fc, - braille_dots_1345678 = 0x10028fd, - braille_dots_2345678 = 0x10028fe, - braille_dots_12345678 = 0x10028ff, - Sinh_ng = 0x1000d82, - Sinh_h2 = 0x1000d83, - Sinh_a = 0x1000d85, - Sinh_aa = 0x1000d86, - Sinh_ae = 0x1000d87, - Sinh_aee = 0x1000d88, - Sinh_i = 0x1000d89, - Sinh_ii = 0x1000d8a, - Sinh_u = 0x1000d8b, - Sinh_uu = 0x1000d8c, - Sinh_ri = 0x1000d8d, - Sinh_rii = 0x1000d8e, - Sinh_lu = 0x1000d8f, - Sinh_luu = 0x1000d90, - Sinh_e = 0x1000d91, - Sinh_ee = 0x1000d92, - Sinh_ai = 0x1000d93, - Sinh_o = 0x1000d94, - Sinh_oo = 0x1000d95, - Sinh_au = 0x1000d96, - Sinh_ka = 0x1000d9a, - Sinh_kha = 0x1000d9b, - Sinh_ga = 0x1000d9c, - Sinh_gha = 0x1000d9d, - Sinh_ng2 = 0x1000d9e, - Sinh_nga = 0x1000d9f, - Sinh_ca = 0x1000da0, - Sinh_cha = 0x1000da1, - Sinh_ja = 0x1000da2, - Sinh_jha = 0x1000da3, - Sinh_nya = 0x1000da4, - Sinh_jnya = 0x1000da5, - Sinh_nja = 0x1000da6, - Sinh_tta = 0x1000da7, - Sinh_ttha = 0x1000da8, - Sinh_dda = 0x1000da9, - Sinh_ddha = 0x1000daa, - Sinh_nna = 0x1000dab, - Sinh_ndda = 0x1000dac, - Sinh_tha = 0x1000dad, - Sinh_thha = 0x1000dae, - Sinh_dha = 0x1000daf, - Sinh_dhha = 0x1000db0, - Sinh_na = 0x1000db1, - Sinh_ndha = 0x1000db3, - Sinh_pa = 0x1000db4, - Sinh_pha = 0x1000db5, - Sinh_ba = 0x1000db6, - Sinh_bha = 0x1000db7, - Sinh_ma = 0x1000db8, - Sinh_mba = 0x1000db9, - Sinh_ya = 0x1000dba, - Sinh_ra = 0x1000dbb, - Sinh_la = 0x1000dbd, - Sinh_va = 0x1000dc0, - Sinh_sha = 0x1000dc1, - Sinh_ssha = 0x1000dc2, - Sinh_sa = 0x1000dc3, - Sinh_ha = 0x1000dc4, - Sinh_lla = 0x1000dc5, - Sinh_fa = 0x1000dc6, - Sinh_al = 0x1000dca, - Sinh_aa2 = 0x1000dcf, - Sinh_ae2 = 0x1000dd0, - Sinh_aee2 = 0x1000dd1, - Sinh_i2 = 0x1000dd2, - Sinh_ii2 = 0x1000dd3, - Sinh_u2 = 0x1000dd4, - Sinh_uu2 = 0x1000dd6, - Sinh_ru2 = 0x1000dd8, - Sinh_e2 = 0x1000dd9, - Sinh_ee2 = 0x1000dda, - Sinh_ai2 = 0x1000ddb, - Sinh_o2 = 0x1000ddc, - Sinh_oo2 = 0x1000ddd, - Sinh_au2 = 0x1000dde, - Sinh_lu2 = 0x1000ddf, - Sinh_ruu2 = 0x1000df2, - Sinh_luu2 = 0x1000df3, - Sinh_kunddaliya = 0x1000df4, - XF86ModeLock = 0x1008FF01, - XF86MonBrightnessUp = 0x1008FF02, - XF86MonBrightnessDown = 0x1008FF03, - XF86KbdLightOnOff = 0x1008FF04, - XF86KbdBrightnessUp = 0x1008FF05, - XF86KbdBrightnessDown = 0x1008FF06, - XF86Standby = 0x1008FF10, - XF86AudioLowerVolume = 0x1008FF11, - XF86AudioMute = 0x1008FF12, - XF86AudioRaiseVolume = 0x1008FF13, - XF86AudioPlay = 0x1008FF14, - XF86AudioStop = 0x1008FF15, - XF86AudioPrev = 0x1008FF16, - XF86AudioNext = 0x1008FF17, - XF86HomePage = 0x1008FF18, - XF86Mail = 0x1008FF19, - XF86Start = 0x1008FF1A, - XF86Search = 0x1008FF1B, - XF86AudioRecord = 0x1008FF1C, - XF86Calculator = 0x1008FF1D, - XF86Memo = 0x1008FF1E, - XF86ToDoList = 0x1008FF1F, - XF86Calendar = 0x1008FF20, - XF86PowerDown = 0x1008FF21, - XF86ContrastAdjust = 0x1008FF22, - XF86RockerUp = 0x1008FF23, - XF86RockerDown = 0x1008FF24, - XF86RockerEnter = 0x1008FF25, - XF86Back = 0x1008FF26, - XF86Forward = 0x1008FF27, - XF86Stop = 0x1008FF28, - XF86Refresh = 0x1008FF29, - XF86PowerOff = 0x1008FF2A, - XF86WakeUp = 0x1008FF2B, - XF86Eject = 0x1008FF2C, - XF86ScreenSaver = 0x1008FF2D, - XF86WWW = 0x1008FF2E, - XF86Sleep = 0x1008FF2F, - XF86Favorites = 0x1008FF30, - XF86AudioPause = 0x1008FF31, - XF86AudioMedia = 0x1008FF32, - XF86MyComputer = 0x1008FF33, - XF86VendorHome = 0x1008FF34, - XF86LightBulb = 0x1008FF35, - XF86Shop = 0x1008FF36, - XF86History = 0x1008FF37, - XF86OpenURL = 0x1008FF38, - XF86AddFavorite = 0x1008FF39, - XF86HotLinks = 0x1008FF3A, - XF86BrightnessAdjust = 0x1008FF3B, - XF86Finance = 0x1008FF3C, - XF86Community = 0x1008FF3D, - XF86AudioRewind = 0x1008FF3E, - XF86BackForward = 0x1008FF3F, - XF86Launch0 = 0x1008FF40, - XF86Launch1 = 0x1008FF41, - XF86Launch2 = 0x1008FF42, - XF86Launch3 = 0x1008FF43, - XF86Launch4 = 0x1008FF44, - XF86Launch5 = 0x1008FF45, - XF86Launch6 = 0x1008FF46, - XF86Launch7 = 0x1008FF47, - XF86Launch8 = 0x1008FF48, - XF86Launch9 = 0x1008FF49, - XF86LaunchA = 0x1008FF4A, - XF86LaunchB = 0x1008FF4B, - XF86LaunchC = 0x1008FF4C, - XF86LaunchD = 0x1008FF4D, - XF86LaunchE = 0x1008FF4E, - XF86LaunchF = 0x1008FF4F, - XF86ApplicationLeft = 0x1008FF50, - XF86ApplicationRight = 0x1008FF51, - XF86Book = 0x1008FF52, - XF86CD = 0x1008FF53, - XF86Calculater = 0x1008FF54, - XF86Clear = 0x1008FF55, - XF86Close = 0x1008FF56, - XF86Copy = 0x1008FF57, - XF86Cut = 0x1008FF58, - XF86Display = 0x1008FF59, - XF86DOS = 0x1008FF5A, - XF86Documents = 0x1008FF5B, - XF86Excel = 0x1008FF5C, - XF86Explorer = 0x1008FF5D, - XF86Game = 0x1008FF5E, - XF86Go = 0x1008FF5F, - XF86iTouch = 0x1008FF60, - XF86LogOff = 0x1008FF61, - XF86Market = 0x1008FF62, - XF86Meeting = 0x1008FF63, - XF86MenuKB = 0x1008FF65, - XF86MenuPB = 0x1008FF66, - XF86MySites = 0x1008FF67, - XF86New = 0x1008FF68, - XF86News = 0x1008FF69, - XF86OfficeHome = 0x1008FF6A, - XF86Open = 0x1008FF6B, - XF86Option = 0x1008FF6C, - XF86Paste = 0x1008FF6D, - XF86Phone = 0x1008FF6E, - XF86Q = 0x1008FF70, - XF86Reply = 0x1008FF72, - XF86Reload = 0x1008FF73, - XF86RotateWindows = 0x1008FF74, - XF86RotationPB = 0x1008FF75, - XF86RotationKB = 0x1008FF76, - XF86Save = 0x1008FF77, - XF86ScrollUp = 0x1008FF78, - XF86ScrollDown = 0x1008FF79, - XF86ScrollClick = 0x1008FF7A, - XF86Send = 0x1008FF7B, - XF86Spell = 0x1008FF7C, - XF86SplitScreen = 0x1008FF7D, - XF86Support = 0x1008FF7E, - XF86TaskPane = 0x1008FF7F, - XF86Terminal = 0x1008FF80, - XF86Tools = 0x1008FF81, - XF86Travel = 0x1008FF82, - XF86UserPB = 0x1008FF84, - XF86User1KB = 0x1008FF85, - XF86User2KB = 0x1008FF86, - XF86Video = 0x1008FF87, - XF86WheelButton = 0x1008FF88, - XF86Word = 0x1008FF89, - XF86Xfer = 0x1008FF8A, - XF86ZoomIn = 0x1008FF8B, - XF86ZoomOut = 0x1008FF8C, - XF86Away = 0x1008FF8D, - XF86Messenger = 0x1008FF8E, - XF86WebCam = 0x1008FF8F, - XF86MailForward = 0x1008FF90, - XF86Pictures = 0x1008FF91, - XF86Music = 0x1008FF92, - XF86Battery = 0x1008FF93, - XF86Bluetooth = 0x1008FF94, - XF86WLAN = 0x1008FF95, - XF86UWB = 0x1008FF96, - XF86AudioForward = 0x1008FF97, - XF86AudioRepeat = 0x1008FF98, - XF86AudioRandomPlay = 0x1008FF99, - XF86Subtitle = 0x1008FF9A, - XF86AudioCycleTrack = 0x1008FF9B, - XF86CycleAngle = 0x1008FF9C, - XF86FrameBack = 0x1008FF9D, - XF86FrameForward = 0x1008FF9E, - XF86Time = 0x1008FF9F, - XF86Select = 0x1008FFA0, - XF86View = 0x1008FFA1, - XF86TopMenu = 0x1008FFA2, - XF86Red = 0x1008FFA3, - XF86Green = 0x1008FFA4, - XF86Yellow = 0x1008FFA5, - XF86Blue = 0x1008FFA6, - XF86Suspend = 0x1008FFA7, - XF86Hibernate = 0x1008FFA8, - XF86TouchpadToggle = 0x1008FFA9, - XF86TouchpadOn = 0x1008FFB0, - XF86TouchpadOff = 0x1008FFB1, - XF86AudioMicMute = 0x1008FFB2, - XF86Keyboard = 0x1008FFB3, - XF86WWAN = 0x1008FFB4, - XF86RFKill = 0x1008FFB5, - XF86AudioPreset = 0x1008FFB6, - XF86Switch_VT_1 = 0x1008FE01, - XF86Switch_VT_2 = 0x1008FE02, - XF86Switch_VT_3 = 0x1008FE03, - XF86Switch_VT_4 = 0x1008FE04, - XF86Switch_VT_5 = 0x1008FE05, - XF86Switch_VT_6 = 0x1008FE06, - XF86Switch_VT_7 = 0x1008FE07, - XF86Switch_VT_8 = 0x1008FE08, - XF86Switch_VT_9 = 0x1008FE09, - XF86Switch_VT_10 = 0x1008FE0A, - XF86Switch_VT_11 = 0x1008FE0B, - XF86Switch_VT_12 = 0x1008FE0C, - XF86Ungrab = 0x1008FE20, - XF86ClearGrab = 0x1008FE21, - XF86Next_VMode = 0x1008FE22, - XF86Prev_VMode = 0x1008FE23, - XF86LogWindowTree = 0x1008FE24, - XF86LogGrabInfo = 0x1008FE25, - SunFA_Grave = 0x1005FF00, - SunFA_Circum = 0x1005FF01, - SunFA_Tilde = 0x1005FF02, - SunFA_Acute = 0x1005FF03, - SunFA_Diaeresis = 0x1005FF04, - SunFA_Cedilla = 0x1005FF05, - SunF36 = 0x1005FF10, - SunF37 = 0x1005FF11, - SunSys_Req = 0x1005FF60, - SunPrint_Screen = 0x0000FF61, - SunCompose = 0x0000FF20, - SunAltGraph = 0x0000FF7E, - SunPageUp = 0x0000FF55, - SunPageDown = 0x0000FF56, - SunUndo = 0x0000FF65, - SunAgain = 0x0000FF66, - SunFind = 0x0000FF68, - SunStop = 0x0000FF69, - SunProps = 0x1005FF70, - SunFront = 0x1005FF71, - SunCopy = 0x1005FF72, - SunOpen = 0x1005FF73, - SunPaste = 0x1005FF74, - SunCut = 0x1005FF75, - SunPowerSwitch = 0x1005FF76, - SunAudioLowerVolume = 0x1005FF77, - SunAudioMute = 0x1005FF78, - SunAudioRaiseVolume = 0x1005FF79, - SunVideoDegauss = 0x1005FF7A, - SunVideoLowerBrightness = 0x1005FF7B, - SunVideoRaiseBrightness = 0x1005FF7C, - SunPowerSwitchShift = 0x1005FF7D, - Dring_accent = 0x1000FEB0, - Dcircumflex_accent = 0x1000FE5E, - Dcedilla_accent = 0x1000FE2C, - Dacute_accent = 0x1000FE27, - Dgrave_accent = 0x1000FE60, - Dtilde = 0x1000FE7E, - Ddiaeresis = 0x1000FE22, - DRemove = 0x1000FF00, - hpClearLine = 0x1000FF6F, - hpInsertLine = 0x1000FF70, - hpDeleteLine = 0x1000FF71, - hpInsertChar = 0x1000FF72, - hpDeleteChar = 0x1000FF73, - hpBackTab = 0x1000FF74, - hpKP_BackTab = 0x1000FF75, - hpModelock1 = 0x1000FF48, - hpModelock2 = 0x1000FF49, - hpReset = 0x1000FF6C, - hpSystem = 0x1000FF6D, - hpUser = 0x1000FF6E, - hpmute_acute = 0x100000A8, - hpmute_grave = 0x100000A9, - hpmute_asciicircum = 0x100000AA, - hpmute_diaeresis = 0x100000AB, - hpmute_asciitilde = 0x100000AC, - hplira = 0x100000AF, - hpguilder = 0x100000BE, - hpYdiaeresis = 0x100000EE, - hpIO = 0x100000EE, - hplongminus = 0x100000F6, - hpblock = 0x100000FC, - osfCopy = 0x1004FF02, - osfCut = 0x1004FF03, - osfPaste = 0x1004FF04, - osfBackTab = 0x1004FF07, - osfBackSpace = 0x1004FF08, - osfClear = 0x1004FF0B, - osfEscape = 0x1004FF1B, - osfAddMode = 0x1004FF31, - osfPrimaryPaste = 0x1004FF32, - osfQuickPaste = 0x1004FF33, - osfPageLeft = 0x1004FF40, - osfPageUp = 0x1004FF41, - osfPageDown = 0x1004FF42, - osfPageRight = 0x1004FF43, - osfActivate = 0x1004FF44, - osfMenuBar = 0x1004FF45, - osfLeft = 0x1004FF51, - osfUp = 0x1004FF52, - osfRight = 0x1004FF53, - osfDown = 0x1004FF54, - osfEndLine = 0x1004FF57, - osfBeginLine = 0x1004FF58, - osfEndData = 0x1004FF59, - osfBeginData = 0x1004FF5A, - osfPrevMenu = 0x1004FF5B, - osfNextMenu = 0x1004FF5C, - osfPrevField = 0x1004FF5D, - osfNextField = 0x1004FF5E, - osfSelect = 0x1004FF60, - osfInsert = 0x1004FF63, - osfUndo = 0x1004FF65, - osfMenu = 0x1004FF67, - osfCancel = 0x1004FF69, - osfHelp = 0x1004FF6A, - osfSelectAll = 0x1004FF71, - osfDeselectAll = 0x1004FF72, - osfReselect = 0x1004FF73, - osfExtend = 0x1004FF74, - osfRestore = 0x1004FF78, - osfDelete = 0x1004FFFF, - Reset = 0x1000FF6C, - System = 0x1000FF6D, - User = 0x1000FF6E, - ClearLine = 0x1000FF6F, - InsertLine = 0x1000FF70, - DeleteLine = 0x1000FF71, - InsertChar = 0x1000FF72, - DeleteChar = 0x1000FF73, - BackTab = 0x1000FF74, - KP_BackTab = 0x1000FF75, - Ext16bit_L = 0x1000FF76, - Ext16bit_R = 0x1000FF77, - mute_acute = 0x100000a8, - mute_grave = 0x100000a9, - mute_asciicircum = 0x100000aa, - mute_diaeresis = 0x100000ab, - mute_asciitilde = 0x100000ac, - lira = 0x100000af, - guilder = 0x100000be, - IO = 0x100000ee, - longminus = 0x100000f6, - block = 0x100000fc, - - } - - enum xkb_key_direction : byte { - KEY_UP, /**< The key was released. */ - KEY_DOWN /**< The key was pressed. */ - } - - [Flags] - enum xkb_state_component : ushort { - XKB_STATE_MODS_DEPRESSED = (1 << 0), - XKB_STATE_MODS_LATCHED = (1 << 1), - XKB_STATE_MODS_LOCKED = (1 << 2), - XKB_STATE_MODS_EFFECTIVE = (1 << 3), - XKB_STATE_LAYOUT_DEPRESSED = (1 << 4), - XKB_STATE_LAYOUT_LATCHED = (1 << 5), - XKB_STATE_LAYOUT_LOCKED = (1 << 6), - XKB_STATE_LAYOUT_EFFECTIVE = (1 << 7), - XKB_STATE_LEDS = (1 << 8) - } - - const string XKB_MOD_NAME_SHIFT ="Shift"; - const string XKB_MOD_NAME_CAPS = "Lock"; - const string XKB_MOD_NAME_CTRL = "Control"; - const string XKB_MOD_NAME_ALT = "Mod1"; - const string XKB_MOD_NAME_NUM = "Mod2"; - const string XKB_MOD_NAME_LOGO = "Mod4"; - - const string XKB_LED_NAME_CAPS = "Caps Lock"; - const string XKB_LED_NAME_NUM = "Num Lock"; - const string XKB_LED_NAME_SCROLL = "Scroll Lock"; - - #region pinvoke XKB - - [DllImportAttribute("xkbcommon")] - static extern IntPtr xkb_context_new (int flags); - [DllImportAttribute("xkbcommon")] - static extern xkb_keysym xkb_state_key_get_one_sym (IntPtr state, xkb_keycode_t keycode); - [DllImportAttribute("xkbcommon")] - static extern int xkb_state_key_get_syms (IntPtr state, xkb_keycode_t keycode, ref IntPtr syms_out); - - [DllImportAttribute("xkbcommon")] - static extern xkb_mod_index_t xkb_keymap_num_mods (IntPtr keymap); - [DllImportAttribute("xkbcommon")] - static extern xkb_mod_index_t xkb_keymap_mod_get_index (IntPtr keymap, string name); - [DllImportAttribute("xkbcommon")] - static extern bool xkb_state_mod_index_is_active (IntPtr state, xkb_mod_index_t idx, xkb_state_component type); - [DllImportAttribute("xkbcommon")] - static extern int xkb_state_mod_name_is_active (IntPtr state, string mod_name, xkb_state_component type); - - [DllImportAttribute("xkbcommon")] - static extern UInt32 xkb_state_key_get_utf32 (IntPtr state, xkb_keycode_t key); - [DllImportAttribute("xkbcommon")] - static extern void xkb_state_unref (IntPtr state); - [DllImportAttribute("xkbcommon")] - static extern void xkb_keymap_unref (IntPtr keymap); - [DllImportAttribute("xkbcommon")] - static extern void xkb_context_unref (IntPtr ctx); - - [DllImportAttribute("xkbcommon")] - static extern xkb_state_component xkb_state_update_key(IntPtr state, xkb_keycode_t key, xkb_key_direction direction); - - [DllImportAttribute("xkbcommon-x11.so.0")] - static extern int xkb_x11_setup_xkb_extension (IntPtr connection, - UInt16 major_xkb_version, UInt16 minor_xkb_version, - byte xkb_x11_setup_xkb_extension_flags, - out UInt16 major_xkb_version_out, - out UInt16 minor_xkb_version_out, - out byte base_event_out, - out byte base_error_out); - [DllImportAttribute("xkbcommon-x11.so.0")] - static extern int xkb_x11_get_core_keyboard_device_id(IntPtr connection); - [DllImportAttribute("xkbcommon-x11.so.0")] - static extern IntPtr xkb_x11_keymap_new_from_device (IntPtr context, IntPtr connection, - int device_id, byte flags); - [DllImportAttribute("xkbcommon-x11.so.0")] - static extern IntPtr xkb_x11_state_new_from_device (IntPtr xkbKeymap, IntPtr connection, int device_id); - #endregion - xkb_mod_index_t ModIdxShift; - xkb_mod_index_t ModIdxCtrl; - xkb_mod_index_t ModIdxAlt; - xkb_mod_index_t ModIdxLogo; - xkb_mod_index_t ModIdxCapsLock; - xkb_mod_index_t ModIdxNumLock; - - IntPtr xkbCtx, xkbKeymap, xkbState; - - Interface iFace; - - - public void HandleEvent (uint keycode, bool pressed) { - xkb_keysym ks = xkb_state_key_get_one_sym (xkbState, keycode); - xkb_key_direction keyDir = xkb_key_direction.KEY_DOWN; - - if (pressed) { - iFace.ProcessKeyDown ((Key)ks); - - IntPtr ptrKeySyms = IntPtr.Zero; - - int nbKeySyms = xkb_state_key_get_syms (xkbState, keycode, ref ptrKeySyms); - int[] keySyms = new int[nbKeySyms]; - Marshal.Copy (ptrKeySyms, keySyms, 0, nbKeySyms); - - uint utf32 = xkb_state_key_get_utf32 (xkbState, keycode); - char c = char.ConvertFromUtf32 ((int)utf32) [0]; - - if (!char.IsControl (c)) - iFace.ProcessKeyPress (c); - } else { - keyDir = xkb_key_direction.KEY_UP; - iFace.ProcessKeyUp ((Key)ks); - } - - xkb_state_update_key (xkbState, keycode, keyDir); - } - public bool IsDown (Key key) { - return false; - } - public bool Shift { - get { - return xkb_state_mod_index_is_active (xkbState, ModIdxShift, xkb_state_component.XKB_STATE_MODS_EFFECTIVE); - } - } - public bool Ctrl { - get { - return xkb_state_mod_index_is_active (xkbState, ModIdxCtrl, xkb_state_component.XKB_STATE_MODS_EFFECTIVE); - } - } - public bool Alt { - get { - return xkb_state_mod_index_is_active (xkbState, ModIdxAlt, xkb_state_component.XKB_STATE_MODS_EFFECTIVE); - } - } - public void Destroy () { - xkb_state_unref (xkbState); - xkb_keymap_unref (xkbKeymap); - xkb_context_unref (xkbCtx); - } - - - public XCBKeyboard (IntPtr xcbConnection, Interface _iface) - { - iFace = _iface; - - ushort xkb_maj, xkb_min; - byte base_evt, base_err; - - xkbCtx = xkb_context_new (0); - xkb_x11_setup_xkb_extension (xcbConnection, 1, 0, 0, out xkb_maj, out xkb_min, out base_evt, out base_err); - int kb = xkb_x11_get_core_keyboard_device_id (xcbConnection); - xkbKeymap = xkb_x11_keymap_new_from_device (xkbCtx, xcbConnection, kb, 0); - xkbState = xkb_x11_state_new_from_device (xkbKeymap, xcbConnection, kb); - - ModIdxShift = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_SHIFT); - ModIdxCtrl = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_CTRL); - ModIdxAlt = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_ALT); - ModIdxLogo = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_LOGO); - ModIdxCapsLock = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_CAPS); - ModIdxNumLock = xkb_keymap_mod_get_index (xkbKeymap, XKB_MOD_NAME_NUM); - } - } -} - diff --git a/Crow/src/backends/xcb/XCursor.cs b/Crow/src/backends/xcb/XCursor.cs deleted file mode 100644 index 1cca510e..00000000 --- a/Crow/src/backends/xcb/XCursor.cs +++ /dev/null @@ -1,151 +0,0 @@ -// -// XCursor.cs -// -// Author: -// Jean-Philippe Bruyère -// -// 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.IO; -using System.Diagnostics; -using System.Collections.Generic; - -namespace Crow -{ - public class XCursorFile - { - const uint XC_TYPE_IMG = 0xfffd0002; - - class toc - { - public uint type; - public uint subtype; - public uint pos; - - public toc(BinaryReader sr) - { - type = sr.ReadUInt32(); - subtype = sr.ReadUInt32(); - pos = sr.ReadUInt32(); - } - } - - public List Cursors = new List(); - - - static XCursorFile loadFromStream(Stream s) - { - List tocList = new List (); - XCursorFile tmp = new XCursorFile (); - - using (BinaryReader sr = new BinaryReader (s)) { - byte[] data; - //magic: CARD32 ’Xcur’ (0x58, 0x63, 0x75, 0x72) - if (new string (sr.ReadChars (4)) != "Xcur") { - Debug.WriteLine ("XCursor Load error: Wrong magic"); - return null; - } - //header: CARD32 bytes in this header - uint headerLength = sr.ReadUInt32 (); - //version: CARD32 file version number - uint version = sr.ReadUInt32 (); - //ntoc: CARD32 number of toc entries - uint nbToc = sr.ReadUInt32 (); - //toc: LISTofTOC table of contents - for (uint i = 0; i < nbToc; i++) { - tocList.Add (new toc (sr)); - } - - foreach (toc t in tocList) { - if (t.type != XC_TYPE_IMG) - continue; - - sr.BaseStream.Seek (t.pos, SeekOrigin.Begin); - tmp.Cursors.Add(imageLoad (sr)); - } - } - return tmp; - } - - public static XCursorFile Load(Interface iface, string path) - { - return loadFromStream (iface.GetStreamFromPath (path)); - } - - static XCursor imageLoad(BinaryReader sr) - { - XCursor tmp = new XCursor(); - // header: 36 Image headers are 36 bytes - uint header = sr.ReadUInt32(); - // type: 0xfffd0002 Image type is 0xfffd0002 - uint type = sr.ReadUInt32(); - // subtype: CARD32 Image subtype is the nominal size - uint subtype = sr.ReadUInt32(); - // version: 1 - uint version = sr.ReadUInt32(); - // width: CARD32 Must be less than or equal to 0x7fff - tmp.Width = sr.ReadUInt32(); - // height: CARD32 Must be less than or equal to 0x7fff - tmp.Height = sr.ReadUInt32(); - // xhot: CARD32 Must be less than or equal to width - tmp.Xhot = sr.ReadUInt32(); - // yhot: CARD32 Must be less than or equal to height - tmp.Yhot = sr.ReadUInt32(); - // delay: CARD32 Delay between animation frames in milliseconds - tmp.Delay = sr.ReadUInt32(); - // pixels: LISTofCARD32 Packed ARGB format pixels - tmp.data = sr.ReadBytes((int)(tmp.Width * tmp.Height * 4)); - return tmp; - } - } - public class XCursor - { - public static XCursor Default; - public static XCursor Cross; - public static XCursor Arrow; - public static XCursor Text; - public static XCursor SW; - public static XCursor SE; - public static XCursor NW; - public static XCursor NE; - public static XCursor N; - public static XCursor S; - public static XCursor V; - public static XCursor H; - - public uint Width; - public uint Height; - public uint Xhot; - public uint Yhot; - public uint Delay; - public byte[] data; - - public XCursor () - { - } -// public static implicit operator MouseCursor(XCursor xc) -// { -// return new MouseCursor((int)xc.Xhot, (int)xc.Yhot, (int)xc.Width, (int)xc.Height,xc.data); -// } - } -} - diff --git a/Crow/src/backends/xlib/X11Keyboard.cs b/Crow/src/backends/xlib/X11Keyboard.cs deleted file mode 100644 index 2af86d3f..00000000 --- a/Crow/src/backends/xlib/X11Keyboard.cs +++ /dev/null @@ -1,120 +0,0 @@ -// -// XCBKeyboard.cs -// -// Author: -// Jean-Philippe Bruyère -// -// 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; - -namespace Crow.XLib -{ - public class X11Keyboard - { - #region PInvoke - [DllImportAttribute("X11")] - static extern IntPtr XFree(IntPtr data); - [DllImport ("libX11")] - static extern void XDisplayKeycodes (IntPtr disp, out int min, out int max); - [DllImport ("libX11")] - static extern IntPtr XGetKeyboardMapping (IntPtr disp, byte first_keycode, int keycode_count, - out int keysyms_per_keycode_return); - [DllImport ("libX11")] - unsafe static extern byte* XGetModifierMapping (IntPtr disp); - [DllImport ("libX11")] - static extern uint XKeycodeToKeysym (IntPtr display, int keycode, int index); - #endregion - - #region IKeyboard implementation - - public event EventHandler KeyDown; - public event EventHandler KeyUp; - public event EventHandler KeyPress; - - public void HandleEvent (uint keycode, bool pressed) { - /*int min_keycode, max_keycode, keysyms_per_keycode; - XLib.NativeMethods.XDisplayKeycodes (xDisp, out min_keycode, out max_keycode); - - IntPtr ksp = XLib.NativeMethods.XGetKeyboardMapping (xDisp, (byte)min_keycode, - max_keycode + 1 - min_keycode, out keysyms_per_keycode); - XLib.NativeMethods.XFree (ksp);*/ - - uint keySym; - keySym = XKeycodeToKeysym (xDisp, (int)keycode, 0); - char c = (char)keySym; - if (pressed) - KeyDown.Raise (this, new KeyEventArgs ((Key)keySym, false)); - else - KeyUp.Raise (this, new KeyEventArgs ((Key)keySym, false)); - } - public bool IsDown (Key key) { - throw new NotImplementedException(); - } - public bool Shift { - get { - throw new NotImplementedException(); - } - } - public bool Ctrl { - get { - throw new NotImplementedException (); - } - } - public bool Alt { - get { - throw new NotImplementedException (); - } - } - public void Destroy () { - - } - #endregion - - - IntPtr xDisp; - - public X11Keyboard (IntPtr _xDisp) - { - xDisp = _xDisp; - - int min_keycode, max_keycode, keysyms_per_keycode; - - XDisplayKeycodes (xDisp, out min_keycode, out max_keycode); - IntPtr ksp = XGetKeyboardMapping (xDisp, (byte) min_keycode, - max_keycode + 1 - min_keycode, out keysyms_per_keycode); - XFree (ksp); - - unsafe { - byte* modmap_unmanaged = XGetModifierMapping (xDisp); - int nummodmap = 0; - int* ptr = (int*)modmap_unmanaged; - nummodmap = ptr [0]; - - for (int i = 0; i< nummodmap; i++) { - Console.WriteLine(modmap_unmanaged[i+4]); - } - XFree ((IntPtr)modmap_unmanaged); - } - } - } -} - diff --git a/Crow/src/backends/xlib/X11Structs.cs b/Crow/src/backends/xlib/X11Structs.cs deleted file mode 100644 index 5e43e006..00000000 --- a/Crow/src/backends/xlib/X11Structs.cs +++ /dev/null @@ -1,1821 +0,0 @@ -// 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.Diagnostics; -using System.Runtime.InteropServices; -using System.Threading; -using System.Reflection; - -// X11 Version -namespace Crow.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 ? "" : 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 -// -// 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.Diagnostics; -using System.Runtime.InteropServices; - -namespace Crow.XLib -{ - public class XLibBackend : IBackend - { - #region pinvoke - [DllImport("X11")] - static extern int XInitThreads(); - [DllImport("X11")] - internal static extern IntPtr XOpenDisplay(IntPtr displayName); - [DllImport("X11")] - internal static extern IntPtr XCloseDisplay(IntPtr disp); - [DllImport("X11")] - static extern Int32 XDefaultScreen(IntPtr disp); - [DllImport("X11")] - static extern IntPtr XDefaultRootWindow(IntPtr disp); - [DllImport("X11")] - static extern UInt32 XDefaultDepth (IntPtr disp, Int32 screen); - [DllImport("X11")] - static extern IntPtr XDefaultVisual(IntPtr disp, Int32 screen); - [DllImport("X11")] - static extern IntPtr XCreateSimpleWindow(IntPtr disp, IntPtr rootWindow, Int32 x, Int32 y, UInt32 width, UInt32 height, - UInt32 borderWidth, IntPtr border, IntPtr background); - [DllImport("X11")] - static extern IntPtr XCreatePixmap(IntPtr disp, IntPtr rootWindow, UInt32 width, UInt32 height, UInt32 depth); - [DllImport("X11")] - static extern IntPtr XFreePixmap(IntPtr disp, IntPtr pixmap); - [DllImport("X11")] - static extern IntPtr XFree(IntPtr data); - [DllImport("X11")] - static extern Int32 XSelectInput(IntPtr disp, IntPtr win, EventMask eventMask); - [DllImport("X11")] - static extern Int32 XMapWindow(IntPtr disp, IntPtr win); - [DllImport("X11")] - static extern int XPending (IntPtr disp); - [DllImport("X11")] - static extern IntPtr XNextEvent(IntPtr disp, ref XEvent xevent); - [DllImport("X11")] - static extern Int32 XSync(IntPtr disp, int discard); - [DllImport("X11")] - static extern int XConnectionNumber(IntPtr disp); - [DllImport("X11")] - static extern IntPtr XSetErrorHandler(XErrorHandler error_handler); - [DllImport ("X11")] - static extern int XDefineCursor (IntPtr disp, IntPtr wnd, IntPtr cursor); - - [DllImport ("X11")] - static extern uint XWarpPointer (IntPtr disp, IntPtr src_w, IntPtr dest_w, int src_x, int src_y, uint src_width, uint src_height, int dest_x, int dest_y); - - [DllImport ("libXcursor.so.1")] - static extern int XcursorGetDefaultSize (IntPtr dpy); - [DllImport ("libXcursor.so.1")] - static extern string XcursorGetTheme (IntPtr dpy); - [DllImport ("libXcursor.so.1")] - static extern IntPtr XcursorLibraryLoadImage (string name, string theme, int size); - [DllImport ("libXcursor.so.1")] - static extern void XcursorImageDestroy (IntPtr image); - - [DllImport ("libXcursor.so.1")] - static extern IntPtr XcursorImageLoadCursor (IntPtr dpy, IntPtr image); - [DllImport ("X11-xcb")] - static extern IntPtr XGetXCBConnection (IntPtr dpy); - #endregion - - IntPtr xDisp, xwinHnd, xDefaultRootWin, xDefaultVisual; - UInt32 xDefaultDepth; - Int32 xScreen; - XErrorHandler errorHnd; - - Interface iFace; - XKB.XCBKeyboard Keyboard; - - IntPtr [] cursors = new IntPtr [(int)MouseCursors.MaxEnum]; - - #region IBackend implementation - - public void Init (Interface _iFace) - { - iFace = _iFace; - XInitThreads (); - xDisp = XOpenDisplay(IntPtr.Zero); - if (xDisp == IntPtr.Zero) - throw new NotSupportedException("[XLib] Failed to open display."); - - IntPtr xcbCon = XGetXCBConnection (xDisp); - Keyboard = new XKB.XCBKeyboard (xcbCon, iFace); - - xScreen = XDefaultScreen(xDisp); - - xDefaultRootWin = XDefaultRootWindow (xDisp); - xDefaultVisual = XDefaultVisual (xDisp, xScreen); - xDefaultDepth = XDefaultDepth (xDisp, xScreen); - - xwinHnd = XCreateSimpleWindow (xDisp, xDefaultRootWin, - 0, 0, (uint)iFace.ClientRectangle.Width, (uint)iFace.ClientRectangle.Height, 0, IntPtr.Zero, IntPtr.Zero); - if (xwinHnd == IntPtr.Zero) - throw new NotSupportedException("[XLib] Failed to create window."); - - XSelectInput (xDisp, xwinHnd, EventMask.ExposureMask | - EventMask.KeyPressMask | EventMask.KeyReleaseMask | - EventMask.PointerMotionMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask); - - XMapWindow (xDisp, xwinHnd); - - //keyboard = new Crow.XLib.X11Keyboard (xDisp); - - iFace.surf = new Crow.Cairo.XlibSurface (xDisp, xwinHnd, xDefaultVisual, iFace.ClientRectangle.Width, iFace.ClientRectangle.Height); - - errorHnd = new XErrorHandler (HandleError); - XSetErrorHandler (errorHnd); - - loadCursors (); - } - - public void CleanUp () - { - Keyboard.Destroy (); - - XCloseDisplay (xDisp); - } - public void Flush () { - XSync (xDisp, 0); - } - public void ProcessEvents () - { - if (XPending (xDisp) > 0) { - XEvent xevent = new XEvent (); - XNextEvent (xDisp, ref xevent); - - switch (xevent.type) { - case XEventName.Expose: - iFace.ProcessResize (new Rectangle (0, 0, xevent.ExposeEvent.width, xevent.ExposeEvent.height)); - break; - case XEventName.KeyPress: - Keyboard.HandleEvent ((uint)xevent.KeyEvent.keycode, true); - break; - case XEventName.KeyRelease: - Keyboard.HandleEvent ((uint)xevent.KeyEvent.keycode, false); - break; - case XEventName.MotionNotify: - //Debug.WriteLine ("motion: ({0},{1})", xevent.MotionEvent.x, xevent.MotionEvent.y); - iFace.ProcessMouseMove (xevent.MotionEvent.x, xevent.MotionEvent.y); - break; - case XEventName.ButtonPress: - //Debug.WriteLine ("button press: {0}", xevent.ButtonEvent.button); - if (xevent.ButtonEvent.button == 4) - iFace.ProcessMouseWheelChanged (Interface.WheelIncrement); - else if(xevent.ButtonEvent.button == 5) - iFace.ProcessMouseWheelChanged (-Interface.WheelIncrement); - else - iFace.ProcessMouseButtonDown ((MouseButton)(xevent.ButtonEvent.button - 1)); - break; - case XEventName.ButtonRelease: - //Debug.WriteLine ("button release: {0}", xevent.ButtonEvent.button); - iFace.ProcessMouseButtonUp ((MouseButton)(xevent.ButtonEvent.button - 1)); - break; - - } - } - } - public bool IsDown (Key key) - { - return false; - } - public bool Shift { - get { return Keyboard.Shift; } - } - public bool Ctrl { - get { return Keyboard.Ctrl; } - } - public bool Alt { - get { return Keyboard.Alt; } - } - public void SetCursor (MouseCursors newCur) - { - XDefineCursor (xDisp, xwinHnd, cursors[(int)newCur]); - XSync (xDisp, 0); - } - public void SetCursorPosition (int x, int y) - { - XWarpPointer (xDisp, IntPtr.Zero, xwinHnd, 0, 0, 0, 0, x, y); - } - #endregion - - void loadCursor (MouseCursors id, string name) - { - IntPtr img = XcursorLibraryLoadImage (name, null, XcursorGetDefaultSize (xDisp)); - cursors[(int)id] = XcursorImageLoadCursor (xDisp, img); - XcursorImageDestroy (img); - } - - void loadCursors () - { - loadCursor (MouseCursors.Default, "default"); - loadCursor (MouseCursors.Cross, "cross"); - loadCursor (MouseCursors.Arrow, "arrow"); - loadCursor (MouseCursors.Text, "text"); - loadCursor (MouseCursors.SW, "bottom_left_corner"); - loadCursor (MouseCursors.SE, "bottom_right_corner"); - loadCursor (MouseCursors.NW, "top_left_corner"); - loadCursor (MouseCursors.NE, "top_right_corner"); - loadCursor (MouseCursors.N, "top_side"); - loadCursor (MouseCursors.S, "bottom_side"); - loadCursor (MouseCursors.V, "size_ver"); - loadCursor (MouseCursors.H, "size_hor"); - } - - int HandleError (IntPtr display, ref 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; - } - - - } -} - diff --git a/Crow/src/debug/DbgEventTypeColors.cs b/Crow/src/debug/DbgEventTypeColors.cs index 1936704e..35ffe23b 100644 --- a/Crow/src/debug/DbgEventTypeColors.cs +++ b/Crow/src/debug/DbgEventTypeColors.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; using System.Linq; namespace Crow diff --git a/Crow/src/debug/DbgLogViewer.cs b/Crow/src/debug/DbgLogViewer.cs index 4ff6082e..eeadd005 100644 --- a/Crow/src/debug/DbgLogViewer.cs +++ b/Crow/src/debug/DbgLogViewer.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Crow.Cairo; +using vkvg; #if DEBUG_LOG namespace Crow diff --git a/Crow/src/debug/DebugLogger.cs b/Crow/src/debug/DebugLogger.cs index f1eaf9c8..ecd7f69a 100644 --- a/Crow/src/debug/DebugLogger.cs +++ b/Crow/src/debug/DebugLogger.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using Crow.Cairo; +using vkvg; using System.Collections.Generic; using System.Diagnostics; using System.IO; diff --git a/Crow/src/rsvg/Handle.cs b/Crow/src/rsvg/Handle.cs index bab0584e..bf565e83 100644 --- a/Crow/src/rsvg/Handle.cs +++ b/Crow/src/rsvg/Handle.cs @@ -1,5 +1,5 @@ -//Copyright GPL2 -using Crow.Cairo; +//Copyright GPL2 +using vkvg; namespace Rsvg { @@ -108,7 +108,7 @@ namespace Rsvg { [DllImport("rsvg-2")] static extern void rsvg_handle_render_cairo_sub(IntPtr raw, IntPtr cr, string id); - public void RenderCairoSub(Crow.Cairo.Context cr, string id) { + public void RenderCairoSub(Context cr, string id) { rsvg_handle_render_cairo_sub(Raw, cr == null ? IntPtr.Zero : cr.Handle, id); } diff --git a/Crow/src/vkvg/Context.cs b/Crow/src/vkvg/Context.cs new file mode 100644 index 00000000..0cf3195e --- /dev/null +++ b/Crow/src/vkvg/Context.cs @@ -0,0 +1,262 @@ +// +// Context.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2018 jp +// +// 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.Text; +using Crow; + +namespace vkvg +{ + public class Context: IDisposable + { + + IntPtr handle = IntPtr.Zero; + + public Context (Surface surf) + { + handle = NativeMethods.vkvg_create (surf.Handle); + } + ~Context () + { + Dispose (false); + } + + public IntPtr Handle { get { return handle; }} + + public void AddReference () { + NativeMethods.vkvg_reference (handle); + } + public uint References () => NativeMethods.vkvg_get_reference_count (handle); + + public double LineWidth { + set { NativeMethods.vkvg_set_line_width (handle, (float)value); } + } + public uint FontSize { + set { NativeMethods.vkvg_set_font_size (handle, value); } + } + public string FontFace { + set { NativeMethods.vkvg_select_font_face (handle, value); } + } + public Operator Operator { + set { NativeMethods.vkvg_set_operator (handle, value); } + get { return NativeMethods.vkvg_get_operator (handle); } + } + public FontExtents FontExtents { + get { + FontExtents f_extents; + NativeMethods.vkvg_font_extents (handle, out f_extents); + return f_extents; + } + } + public TextExtents TextExtents(string s) + { + TextExtents extents; + NativeMethods.vkvg_text_extents (handle, TerminateUtf8(s), out extents); + return extents; + } + public void ShowText (string txt) { + NativeMethods.vkvg_show_text (handle, txt); + } + public void Save () { + NativeMethods.vkvg_save (handle); + } + public void Restore () { + NativeMethods.vkvg_restore (handle); + } + public void Flush () { + NativeMethods.vkvg_flush (handle); + } + public void Clear () { + NativeMethods.vkvg_clear (handle); + } + + public void Paint () { + NativeMethods.vkvg_paint (handle); + } + public void Arc (float xc, float yc, float radius, float a1, float a2) { + NativeMethods.vkvg_arc (handle, xc, yc, radius, a1, a2); + } + public void Arc (double xc, double yc, double radius, double a1, double a2) { + NativeMethods.vkvg_arc (handle, (float)xc, (float)yc, (float)radius, (float)a1, (float)a2); + } + public void ArcNegative (float xc, float yc, float radius, float a1, float a2) { + NativeMethods.vkvg_arc_negative (handle, xc, yc, radius, a1, a2); + } + public void Rectangle (float x, float y, float width, float height) { + NativeMethods.vkvg_rectangle (handle, x, y, width, height); + } + public void Scale (float sx, float sy) { + NativeMethods.vkvg_scale (handle, sx, sy); + } + public void Translate (float dx, float dy) { + NativeMethods.vkvg_translate (handle, dx, dy); + } + public void Rotate (float alpha) { + NativeMethods.vkvg_rotate (handle, alpha); + } + public void ArcNegative (double xc, double yc, double radius, double a1, double a2) { + NativeMethods.vkvg_arc_negative (handle, (float)xc, (float)yc, (float)radius, (float)a1, (float)a2); + } + public void Rectangle (double x, double y, double width, double height) { + NativeMethods.vkvg_rectangle (handle, (float)x, (float)y, (float)width, (float)height); + } + public void Scale (double sx, double sy) { + NativeMethods.vkvg_scale (handle, (float)sx, (float)sy); + } + public void Translate (double dx, double dy) { + NativeMethods.vkvg_translate (handle, (float)dx, (float)dy); + } + public void Rotate (double alpha) { + NativeMethods.vkvg_rotate (handle, (float)alpha); + } + + public void Fill () { + NativeMethods.vkvg_fill (handle); + } + public void FillPreserve () { + NativeMethods.vkvg_fill_preserve (handle); + } + public void Stroke () { + NativeMethods.vkvg_stroke (handle); + } + public void StrokePreserve () { + NativeMethods.vkvg_stroke_preserve (handle); + } + public void Clip () { + NativeMethods.vkvg_clip (handle); + } + public void ClipPreserve () { + NativeMethods.vkvg_clip_preserve (handle); + } + public void ResetClip () { + NativeMethods.vkvg_reset_clip (handle); + } + public void NewPath () { + NativeMethods.vkvg_new_path (handle); + } + public void NewSubPath () { + NativeMethods.vkvg_new_sub_path (handle); + } + public void ClosePath () { + NativeMethods.vkvg_close_path (handle); + } + +// public void Rectangle (float x, float y, float width, float height){ +// NativeMethods.vkvg_rectangle (); +// } + public void MoveTo (PointD p){ + NativeMethods.vkvg_move_to (handle, (float)p.X, (float)p.Y); + } + public void MoveTo (Point p){ + NativeMethods.vkvg_move_to (handle, p.X, p.Y); + } + public void MoveTo (float x, float y){ + NativeMethods.vkvg_move_to (handle, x, y); + } + public void RelMoveTo (float x, float y){ + NativeMethods.vkvg_rel_move_to (handle, x, y); + } + public void LineTo (float x, float y){ + NativeMethods.vkvg_line_to (handle, x, y); + } + public void LineTo (Point p){ + NativeMethods.vkvg_line_to (handle, p.X, p.Y); + } + public void LineTo (PointD p){ + NativeMethods.vkvg_line_to (handle, (float)p.X, (float)p.Y); + } + public void RelLineTo (float x, float y){ + NativeMethods.vkvg_rel_line_to (handle, x, y); + } + public void CurveTo (float x1, float y1, float x2, float y2, float x3, float y3){ + NativeMethods.vkvg_curve_to (handle, x1, y1, x2, y2, x3, y3); + } + public void RelCurveTo (float x1, float y1, float x2, float y2, float x3, float y3){ + NativeMethods.vkvg_rel_curve_to (handle, x1, y1, x2, y2, x3, y3); + } + + public void MoveTo (double x, double y){ + NativeMethods.vkvg_move_to (handle, (float)x, (float)y); + } + public void RelMoveTo (double x, double y){ + NativeMethods.vkvg_rel_move_to (handle, (float)x, (float)y); + } + public void LineTo (double x, double y){ + NativeMethods.vkvg_line_to (handle, (float)x, (float)y); + } + public void RelLineTo (double x, double y){ + NativeMethods.vkvg_rel_line_to (handle, (float)x, (float)y); + } + public void CurveTo (double x1, double y1, double x2, double y2, double x3, double y3){ + NativeMethods.vkvg_curve_to (handle, (float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3); + } + public void RelCurveTo (double x1, double y1, double x2, double y2, double x3, double y3){ + NativeMethods.vkvg_rel_curve_to (handle, (float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3); + } + + public void SetSource (Pattern pat) { + NativeMethods.vkvg_set_source (handle, pat.Handle); + } + public void SetSource (float r, float g, float b, float a = 1f) { + NativeMethods.vkvg_set_source_rgba (handle, r, g, b, a); + } + public void SetSource (double r, double g, double b, double a = 1.0) { + NativeMethods.vkvg_set_source_rgba (handle, (float)r, (float)g, (float)b, (float)a); + } + public void SetSource (Surface surf, float x = 0f, float y = 0f) { + NativeMethods.vkvg_set_source_surface (handle, surf.Handle, x, y); + } + public void SetSourceSurface (Surface surf, float x = 0f, float y = 0f) { + NativeMethods.vkvg_set_source_surface (handle, surf.Handle, x, y); + } + + private static byte[] TerminateUtf8(string s) + { + // compute the byte count including the trailing \0 + var byteCount = Encoding.UTF8.GetMaxByteCount(s.Length + 1); + var bytes = new byte[byteCount]; + Encoding.UTF8.GetBytes(s, 0, s.Length, bytes, 0); + return bytes; + } + + #region IDisposable implementation + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) + { + if (!disposing || handle == IntPtr.Zero) + return; + + NativeMethods.vkvg_destroy (handle); + handle = IntPtr.Zero; + } + #endregion + } +} + diff --git a/Crow/src/vkvg/Device.cs b/Crow/src/vkvg/Device.cs new file mode 100644 index 00000000..1a1b4b56 --- /dev/null +++ b/Crow/src/vkvg/Device.cs @@ -0,0 +1,77 @@ +// +// Context.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2018 jp +// +// 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 vkvg +{ + public class Device: IDisposable + { + + IntPtr handle = IntPtr.Zero; + + #region CTORS & DTOR + public Device (IntPtr instance, IntPtr phy, IntPtr dev, uint qFamIdx, SampleCount samples = SampleCount.Sample_1, uint qIndex = 0) + { + handle = NativeMethods.vkvg_device_create_multisample (instance, phy, dev, qFamIdx, qIndex, samples, false); + } + ~Device () + { + Dispose (false); + } + #endregion + + public void GetDpy (out int hdpy, out int vdpy) { + NativeMethods.vkvg_device_get_dpy (handle, out hdpy, out vdpy); + } + public void SetDpy (int hdpy, int vdpy) { + NativeMethods.vkvg_device_set_dpy (handle, hdpy, vdpy); + } + public void AddReference () { + NativeMethods.vkvg_device_reference (handle); + } + public uint References () => NativeMethods.vkvg_device_get_reference_count (handle); + + public IntPtr Handle { get { return handle; }} + + #region IDisposable implementation + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) + { + if (!disposing || handle == IntPtr.Zero) + return; + + NativeMethods.vkvg_device_destroy (handle); + handle = IntPtr.Zero; + } + #endregion + } +} + diff --git a/Crow/src/vkvg/Enums.cs b/Crow/src/vkvg/Enums.cs new file mode 100644 index 00000000..44b0d087 --- /dev/null +++ b/Crow/src/vkvg/Enums.cs @@ -0,0 +1,139 @@ +// +// Enums.cs +// +// Author: +// Jean-Philippe Bruyère +// +// 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 vkvg { + public enum Status { + Success = 0, + NoMemory, + InvalidRestore, + InvalidPopGroup, + NoCurrentPoint, + InvalidMatrix, + InvalidStatus, + NullPointer, + InvalidString, + InvalidPathData, + ReadError, + WriteError, + SurfaceFinished, + SurfaceTypeMismatch, + PatternTypeMismatch, + InvalidContent, + InvalidFormat, + InvalidVisual, + FileNotFound, + InvalidDash + } + + public enum Direction { + Horizontal = 0, + Vertical = 1 + } + + public enum Format { + ARGB32, + RGB24, + A8, + A1 + } + + public enum Extend { + None, + Repeat, + Reflect, + Pad + } + + public enum Filter { + Fast, + Good, + Best, + Nearest, + Bilinear, + Gaussian, + } + + public enum PatternType { + Solid, + Surface, + Linear, + Radial, + Mesh, + RasterSource, + } + + public enum Operator { + Clear, + Source, + Over, + In, + Out, + Atop, + + Dest, + DestOver, + DestIn, + DestOut, + DestAtop, + + Xor, + Add, + Saturate, + } + + public enum FontSlant { + Normal, + Italic, + Oblique + } + public enum FontWeight { + Normal, + Bold, + } + + public enum SampleCount { + Sample_1 = 0x00000001, + Sample_2 = 0x00000002, + Sample_4 = 0x00000004, + Sample_8 = 0x00000008, + Sample_16 = 0x00000010, + Sample_32 = 0x00000020, + Sample_64 = 0x00000040 + } + + public enum LineCap { + Butt, + Round, + Square + } + + public enum LineJoin { + Miter, + Round, + Bevel + } +} \ No newline at end of file diff --git a/Crow/src/Mono.Cairo/FontExtents.cs b/Crow/src/vkvg/FontExtents.cs similarity index 88% rename from Crow/src/Mono.Cairo/FontExtents.cs rename to Crow/src/vkvg/FontExtents.cs index ea26d9bb..c7f793df 100644 --- a/Crow/src/Mono.Cairo/FontExtents.cs +++ b/Crow/src/vkvg/FontExtents.cs @@ -34,43 +34,43 @@ using System; using System.Runtime.InteropServices; -namespace Crow.Cairo +namespace vkvg { [StructLayout (LayoutKind.Sequential)] public struct FontExtents { - double ascent; - double descent; - double height; - double maxXAdvance; - double maxYAdvance; + float ascent; + float descent; + float height; + float maxXAdvance; + float maxYAdvance; - public double Ascent { + public float Ascent { get { return ascent; } set { ascent = value; } } - public double Descent { + public float Descent { get { return descent; } set { descent = value; } } - public double Height { + public float Height { get { return height; } set { height = value; } } - public double MaxXAdvance { + public float MaxXAdvance { get { return maxXAdvance; } set { maxXAdvance = value; } } - public double MaxYAdvance { + public float MaxYAdvance { get { return maxYAdvance; } set { maxYAdvance = value; } } - public FontExtents (double ascent, double descent, double height, double maxXAdvance, double maxYAdvance) + public FontExtents (float ascent, float descent, float height, float maxXAdvance, float maxYAdvance) { this.ascent = ascent; this.descent = descent; diff --git a/Crow/src/vkvg/Matrix.cs b/Crow/src/vkvg/Matrix.cs new file mode 100644 index 00000000..54859e45 --- /dev/null +++ b/Crow/src/vkvg/Matrix.cs @@ -0,0 +1,113 @@ +// +// Matrix.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2019 jp +// +// 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 vkvg { + public struct Matrix { + float xx; float yx; + float xy; float yy; + float x0; float y0; + + public float XX { get { return xx; } set { xx = value; } } + public float YX { get { return yx; } set { yx = value; } } + public float XY { get { return xy; } set { xy = value; } } + public float YY { get { return yy; } set { yy = value; } } + public float X0 { get { return x0; } set { x0 = value; } } + public float Y0 { get { return y0; } set { y0 = value; } } + + public static Matrix Create (float xx, float yx, float xy, float yy, float x0, float y0) { + Matrix tmp; + NativeMethods.vkvg_matrix_init (out tmp, xx, yx, xy, yy, x0, y0); + return tmp; + } + public static Matrix CreateTranslation (float tx, float ty) { + Matrix tmp; + NativeMethods.vkvg_matrix_init_translate (out tmp, tx, ty); + return tmp; + } + public static Matrix CreateRotation (float radian) { + Matrix tmp; + NativeMethods.vkvg_matrix_init_rotate (out tmp, radian); + return tmp; + } + public static Matrix CreateScale (float sx, float sy) { + Matrix tmp; + NativeMethods.vkvg_matrix_init_scale (out tmp, sx, sy); + return tmp; + } + public static Matrix Identity { + get { + Matrix tmp; + NativeMethods.vkvg_matrix_init_identity (out tmp); + return tmp; + } + } + + public void Translate (float tx, float ty) { + Matrix tmp = this; + NativeMethods.vkvg_matrix_translate (ref tmp, tx, ty); + xx = tmp.xx; yx = tmp.yx; + xy = tmp.xy; yy = tmp.yy; + x0 = tmp.x0; y0 = tmp.y0; + } + public void Rotate (float radian) { + Matrix tmp = this; + NativeMethods.vkvg_matrix_rotate (ref tmp, radian); + xx = tmp.xx; yx = tmp.yx; + xy = tmp.xy; yy = tmp.yy; + x0 = tmp.x0; y0 = tmp.y0; + } + public void Scale (float sx, float sy) { + Matrix tmp = this; + NativeMethods.vkvg_matrix_scale (ref tmp, sx, sy); + xx = tmp.xx; yx = tmp.yx; + xy = tmp.xy; yy = tmp.yy; + x0 = tmp.x0; y0 = tmp.y0; + } + public void Invert () { + Matrix tmp = this; + NativeMethods.vkvg_matrix_invert (ref tmp); + xx = tmp.xx; yx = tmp.yx; + xy = tmp.xy; yy = tmp.yy; + x0 = tmp.x0; y0 = tmp.y0; + } + public void TransformDistance (ref float dx, ref float dy) { + NativeMethods.vkvg_matrix_transform_distance (ref this, ref dx, ref dy); + } + public void TransformPoint (ref float px, ref float py) { + NativeMethods.vkvg_matrix_transform_distance (ref this, ref px, ref py); + } + + public static Matrix operator *(Matrix a, Matrix b) { + Matrix tmp; + NativeMethods.vkvg_matrix_multiply (out tmp, ref a, ref b); + return tmp; + } + + public override string ToString () { + return string.Format ($"({xx};{yx};{xy};{yy};{x0};{y0})"); + } + } +} diff --git a/Crow/src/vkvg/NativeMethods.cs b/Crow/src/vkvg/NativeMethods.cs new file mode 100644 index 00000000..e598170d --- /dev/null +++ b/Crow/src/vkvg/NativeMethods.cs @@ -0,0 +1,266 @@ +// +// NativeMethods.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2018 jp +// +// 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; + +namespace vkvg +{ + internal static class NativeMethods + { + const string libvkvg = "vkvg"; + + #region Device + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_device_create (IntPtr instance, IntPtr phy, IntPtr dev, uint qFamIdx, uint qIndex); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_device_destroy (IntPtr device); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_device_create_multisample (IntPtr inst, IntPtr phy, IntPtr vkdev, uint qFamIdx, uint qIndex, SampleCount samples, bool deferredResolve); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_device_reference (IntPtr dev); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern uint vkvg_device_get_reference_count (IntPtr dev); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_device_set_dpy (IntPtr dev, int hdpy, int vdpy); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_device_get_dpy (IntPtr dev, out int hdpy, out int vdpy); + #endregion + + #region Context + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_create (IntPtr surface); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_destroy (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_flush (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_new_path (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_new_sub_path (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_close_path (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_line_to (IntPtr ctx, float x, float y); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_rel_line_to (IntPtr ctx, float x, float y); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_move_to (IntPtr ctx, float x, float y); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_rel_move_to (IntPtr ctx, float x, float y); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_arc (IntPtr ctx, float xc, float yc, float radius, float a1, float a2); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_arc_negative (IntPtr ctx, float xc, float yc, float radius, float a1, float a2); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_curve_to (IntPtr ctx, float x1, float y1, float x2, float y2, float x3, float y3); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_rel_curve_to (IntPtr ctx, float x1, float y1, float x2, float y2, float x3, float y3); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_rectangle (IntPtr ctx, float x, float y, float width, float height); + + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_scale (IntPtr ctx, float sx, float sy); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_translate (IntPtr ctx, float dx, float dy); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_rotate (IntPtr ctx, float alpha); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_transform (IntPtr ctx, ref Matrix matrix); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_matrix (IntPtr ctx, ref Matrix matrix); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_get_matrix (IntPtr ctx, out Matrix matrix); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_identity_matrix (IntPtr ctx); + + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_stroke (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_stroke_preserve (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_clip (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_clip_preserve (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_reset_clip (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_fill (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_fill_preserve (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_paint (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_source_rgba (IntPtr ctx, float r, float g, float b, float a); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_line_width (IntPtr ctx, float width); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_line_cap (IntPtr ctx, LineCap cap); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_line_join (IntPtr ctx, LineJoin join); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_operator (IntPtr ctx, Operator op); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern Operator vkvg_get_operator (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_source_surface(IntPtr ctx, IntPtr surf, float x, float y); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_source(IntPtr ctx, IntPtr pattern); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_font_extents (IntPtr ctx, out FontExtents extents); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_text_extents (IntPtr ctx, byte[] utf8, out TextExtents extents); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_select_font_face (IntPtr ctx, string name); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_set_font_size (IntPtr ctx, uint size); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_show_text (IntPtr ctx, string text); + + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_save (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_restore (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_clear (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern float vkvg_get_line_width (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern LineCap vkvg_get_line_cap (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern LineJoin vkvg_get_line_join (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_get_source (IntPtr ctx); + + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_reference (IntPtr ctx); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern uint vkvg_get_reference_count (IntPtr ctx); + #endregion + + #region TextRun + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_text_run_create (IntPtr ctx, byte[] utf8); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_text_run_destroy (IntPtr textRun); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_show_text_run (IntPtr ctx, IntPtr textRun); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_text_run_get_extents (IntPtr textRun); + #endregion + + #region Pattern + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_pattern_create (); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_pattern_reference (IntPtr pat); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern uint vkvg_pattern_get_reference_count(IntPtr pat); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_pattern_create_rgba (float r, float g, float b, float a); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_pattern_create_rgb (float r, float g, float b); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_pattern_create_for_surface (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_pattern_create_linear (float x0, float y0, float x1, float y1); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_pattern_create_radial (float cx0, float cy0, float radius0, + float cx1, float cy1, float radius1); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_pattern_destroy (IntPtr pat); + + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_patter_add_color_stop (IntPtr pat, float offset, float r, float g, float b, float a); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_pattern_set_extend (IntPtr pat, Extend extend); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_pattern_set_filter (IntPtr pat, Filter filter); + + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern Extend vkvg_pattern_get_extend (IntPtr pat); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern Filter vkvg_pattern_get_filter (IntPtr pat); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern PatternType vkvg_pattern_get_type (IntPtr pat); + #endregion + + #region Matrices + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_init_identity (out Matrix matrix); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_init (out Matrix matrix, + float xx, float yx, + float xy, float yy, + float x0, float y0); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_init_translate (out Matrix matrix, float tx, float ty); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_init_scale (out Matrix matrix, float sx, float sy); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_init_rotate (out Matrix matrix, float radians); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_translate (ref Matrix matrix, float tx, float ty); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_scale (ref Matrix matrix, float sx, float sy); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_rotate (ref Matrix matrix, float radians); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_multiply (out Matrix result, ref Matrix a, ref Matrix b); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_transform_distance (ref Matrix matrix, ref float dx, ref float dy); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_transform_point (ref Matrix matrix, ref float x, ref float y); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_matrix_invert (ref Matrix matrix); + #endregion + + #region Surface + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_surface_create (IntPtr device, uint width, uint height); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_surface_create_from_image (IntPtr dev, string filePath); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_surface_create_from_bitmap (IntPtr dev, ref byte[] data, uint width, uint height); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_surface_destroy (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_surface_get_vk_image (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern int vkvg_surface_get_width (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern int vkvg_surface_get_height (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_surface_clear (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern IntPtr vkvg_surface_reference (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern uint vkvg_surface_get_reference_count (IntPtr surf); + [DllImport (libvkvg, CallingConvention=CallingConvention.Cdecl)] + internal static extern void vkvg_surface_write_to_png (IntPtr surf, [MarshalAs(UnmanagedType.LPStr)]string path); + #endregion + } +} + diff --git a/Crow/src/vkvg/Pattern.cs b/Crow/src/vkvg/Pattern.cs new file mode 100644 index 00000000..f6746ffb --- /dev/null +++ b/Crow/src/vkvg/Pattern.cs @@ -0,0 +1,97 @@ +// +// Pattern.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2019 jp +// +// 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 vkvg { + public class Pattern : IDisposable { + + IntPtr handle = IntPtr.Zero; + + #region CTORS & DTOR + protected Pattern (IntPtr handle) { + this.handle = handle; + } + public Pattern () { + handle = NativeMethods.vkvg_pattern_create (); + } + public Pattern (float r, float g, float b) { + handle = NativeMethods.vkvg_pattern_create_rgb (r, g, b); + } + public Pattern (float r, float g, float b, float a) { + handle = NativeMethods.vkvg_pattern_create_rgba (r, g, b, a); + } + public Pattern (Surface surf) { + handle = NativeMethods.vkvg_pattern_create_for_surface (surf.Handle); + } + + ~Pattern () { + Dispose (false); + } + #endregion + + public static Pattern CreateLinearGradient (float x0, float y0, float x1, float y1) { + return new Pattern (NativeMethods.vkvg_pattern_create_linear (x0, y0, x1, y1)); + } + public static Pattern CreateRadialGradient (float cx0, float cy0, float radius0, + float cx1, float cy1, float radius1) { + return new Pattern (NativeMethods.vkvg_pattern_create_radial (cx0, cy0, radius0, cx1, cy1, radius1)); + } + + public void AddReference () { + NativeMethods.vkvg_pattern_reference (handle); + } + public uint References () => NativeMethods.vkvg_pattern_get_reference_count (handle); + + public IntPtr Handle { get { return handle; } } + + public Extend Extend { + set { NativeMethods.vkvg_pattern_set_extend (handle, value); } + get { return NativeMethods.vkvg_pattern_get_extend (handle); } + } + public Filter Filter { + set { NativeMethods.vkvg_pattern_set_filter (handle, value); } + get { return NativeMethods.vkvg_pattern_get_filter (handle); } + } + + public void AddColorStop (float offset, float r, float g, float b, float a = 1f) { + NativeMethods.vkvg_patter_add_color_stop (handle, offset, r, g, b, a); + } + + #region IDisposable implementation + public void Dispose () { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) { + if (!disposing || handle == IntPtr.Zero) + return; + + NativeMethods.vkvg_pattern_destroy (handle); + handle = IntPtr.Zero; + } + #endregion + } +} \ No newline at end of file diff --git a/Crow/src/vkvg/Point.cs b/Crow/src/vkvg/Point.cs new file mode 100644 index 00000000..a30e231d --- /dev/null +++ b/Crow/src/vkvg/Point.cs @@ -0,0 +1,180 @@ +// +// Point.cs +// +// Author: +// Jean-Philippe Bruyère +// +// 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 vkvg { + public struct Point + { + int _x; + int _y; + + public int X + { + get { return _x; } + set { _x = value; } + } + public int Y + { + get { return _y; } + set { _y = value; } + } + public Point(int x, int y) + { + _x = x; + _y = y; + } + + public int Length { + get { return (int)Math.Sqrt (Math.Pow (_x, 2) + Math.Pow (_y, 2)); } + } + public double LengthD { + get { return Math.Sqrt (Math.Pow (_x, 2) + Math.Pow (_y, 2)); } + } + public static implicit operator PointD(Point p) + { + return new PointD(p.X, p.Y); + } + public static implicit operator System.Drawing.Point(Point p) + { + return new System.Drawing.Point(p.X, p.Y); + } + public static implicit operator Point(System.Drawing.Point p) + { + return new Point(p.X, p.Y); + } + public static implicit operator Point(int i) + { + return new Point(i, i); + } + public static Point operator /(Point p, int d) + { + return new Point(p.X / d, p.Y / d); + } + public static Point operator *(Point p, int d) + { + return new Point(p.X * d, p.Y * d); + } + public static Point operator /(Point p, double d) + { + return new Point((int)(p.X / d), (int)(p.Y / d)); + } + public static Point operator *(Point p, double d) + { + return new Point((int)(p.X * d), (int)(p.Y * d)); + } + public static Point operator +(Point p1, Point p2) + { + return new Point(p1.X + p2.X, p1.Y + p2.Y); + } + public static Point operator +(Point p, int i) + { + return new Point(p.X + i, p.Y + i); + } + public static Point operator -(Point p1, Point p2) + { + return new Point(p1.X - p2.X, p1.Y - p2.Y); + } + public static bool operator >=(Point p1, Point p2) + { + return p1.X >= p2.X && p1.Y >= p2.Y ? true : false; + } + public static bool operator <=(Point p1, Point p2) + { + return p1.X <= p2.X && p1.Y <= p2.Y ? true : false; + } + public static bool operator ==(Point s, int i) + { + if (s.X == i && s.Y == i) + return true; + else + return false; + } + public static bool operator !=(Point s, int i) + { + if (s.X == i && s.Y == i) + return false; + else + return true; + } + public static bool operator >(Point s, int i) + { + if (s.X > i && s.Y > i) + return true; + else + return false; + } + public static bool operator <(Point s, int i) + { + if (s.X < i && s.Y < i) + return true; + else + return false; + } + public static bool operator ==(Point s1, Point s2) + { + if (s1.X == s2.X && s1.Y == s2.Y) + return true; + else + return false; + } + public static bool operator !=(Point s1, Point s2) + { + if (s1.X == s2.X && s1.Y == s2.Y) + return false; + else + return true; + } + + public override string ToString() + { + return string.Format("({0},{1})", X, Y); + } + + public override bool Equals(object obj) + { + return base.Equals(obj); + } + public override int GetHashCode() + { + return base.GetHashCode(); + } + public static Point Parse(string s) + { + if (string.IsNullOrEmpty (s)) + return default(Point); + string[] d = s.Trim().Split(','); + if (d.Length == 2) + return new Point (int.Parse (d [0]), int.Parse (d [1])); + else if (d.Length == 1) { + int tmp = int.Parse (d [0]); + return new Point (tmp, tmp); + } + throw new Exception ("Crow.Point Parsing Error: " + s); + } + } + +} diff --git a/Crow/src/Mono.Cairo/PointD.cs b/Crow/src/vkvg/PointD.cs similarity index 97% rename from Crow/src/Mono.Cairo/PointD.cs rename to Crow/src/vkvg/PointD.cs index 8bc019c9..a36f8178 100644 --- a/Crow/src/Mono.Cairo/PointD.cs +++ b/Crow/src/vkvg/PointD.cs @@ -1,5 +1,5 @@ // -// Mono.Cairo.Context.cs +// Mono.Context.cs // // Author: // Duncan Mak (duncan@ximian.com) @@ -34,7 +34,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -namespace Crow.Cairo { +namespace vkvg { public struct PointD { diff --git a/Crow/src/vkvg/Surface.cs b/Crow/src/vkvg/Surface.cs new file mode 100644 index 00000000..c1c25594 --- /dev/null +++ b/Crow/src/vkvg/Surface.cs @@ -0,0 +1,105 @@ +// +// Context.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2018 jp +// +// 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 vkvg +{ + public class Surface: IDisposable + { + IntPtr handle = IntPtr.Zero; + Device vkvgDev; + + public Surface (Device device, int width, int heigth) + { + vkvgDev = device; + handle = NativeMethods.vkvg_surface_create (device.Handle, (uint)width, (uint)heigth); + } + public Surface (Device device, ref byte[] data, int width, int heigth) + { + vkvgDev = device; + handle = NativeMethods.vkvg_surface_create (device.Handle, (uint)width, (uint)heigth); + } + public Surface (Device device, string imgPath) { + vkvgDev = device; + handle = NativeMethods.vkvg_surface_create_from_image (device.Handle, imgPath); + } + + Surface (IntPtr devHandle, int width, int heigth) + { + handle = NativeMethods.vkvg_surface_create (devHandle, (uint)width, (uint)heigth); + } + ~Surface () + { + Dispose (false); + } + + public IntPtr Handle { get { return handle; }} + public IntPtr VkImage { get { return NativeMethods.vkvg_surface_get_vk_image (handle); }} + public int Width { get { return NativeMethods.vkvg_surface_get_width (handle); }} + public int Height { get { return NativeMethods.vkvg_surface_get_height (handle); }} + + public void AddReference () { + NativeMethods.vkvg_surface_reference (handle); + } + public uint References () => NativeMethods.vkvg_surface_get_reference_count (handle); + +// public Surface CreateSimilar (uint width, uint height) { +// return new Surface (handle, width, height); +// } +// public Surface CreateSimilar (int width, int height) { +// return new Surface (handle, (uint)width, (uint)height); +// } + + public void Flush () { + throw new NotImplementedException (); + } + + public void WriteToPng (string path) { + NativeMethods.vkvg_surface_write_to_png (handle, path); + } + public void Clear () { + NativeMethods.vkvg_surface_clear (handle); + } + + #region IDisposable implementation + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) + { + if (!disposing || handle == IntPtr.Zero) + return; + + NativeMethods.vkvg_surface_destroy (handle); + handle = IntPtr.Zero; + } + #endregion + } +} + diff --git a/Crow/src/Mono.Cairo/TextExtents.cs b/Crow/src/vkvg/TextExtents.cs similarity index 89% rename from Crow/src/Mono.Cairo/TextExtents.cs rename to Crow/src/vkvg/TextExtents.cs index 965ca046..2305d9a1 100644 --- a/Crow/src/Mono.Cairo/TextExtents.cs +++ b/Crow/src/vkvg/TextExtents.cs @@ -31,44 +31,44 @@ using System; using System.Runtime.InteropServices; -namespace Crow.Cairo +namespace vkvg { [StructLayout (LayoutKind.Sequential)] public struct TextExtents { - double xbearing; - double ybearing; - double width; - double height; - double xadvance; - double yadvance; + float xbearing; + float ybearing; + float width; + float height; + float xadvance; + float yadvance; - public double XBearing { + public float XBearing { get { return xbearing; } set { xbearing = value; } } - public double YBearing { + public float YBearing { get { return ybearing; } set { ybearing = value; } } - public double Width { + public float Width { get { return width; } set { width = value; } } - public double Height { + public float Height { get { return height; } set { height = value; } } - public double XAdvance { + public float XAdvance { get { return xadvance; } set { xadvance = value; } } - public double YAdvance { + public float YAdvance { get { return yadvance; } set { yadvance = value; } } -- 2.47.3