Major production merge: GTK support, context menus, and dispatcher fixes
Core Infrastructure: - Add Dispatching folder with LinuxDispatcher, LinuxDispatcherProvider, LinuxDispatcherTimer - Add Native folder with P/Invoke wrappers (GTK, GLib, GDK, Cairo, WebKit) - Add GTK host window system with GtkHostWindow and GtkSkiaSurfaceWidget - Update LinuxApplication with GTK mode, theme handling, and icon support - Fix duplicate LinuxDispatcher in LinuxMauiContext Handlers: - Add GtkWebViewManager and GtkWebViewPlatformView for GTK WebView - Add FlexLayoutHandler and GestureManager - Update multiple handlers with ToViewHandler fix and missing mappers - Add MauiHandlerExtensions with ToViewHandler extension method Views: - Add SkiaContextMenu with hover, keyboard, and dark theme support - Add LinuxDialogService with context menu management - Add SkiaFlexLayout for flex container support - Update SkiaShell with RefreshTheme, MauiShell, ContentRenderer - Update SkiaWebView with SetMainWindow, ProcessGtkEvents - Update SkiaImage with LoadFromBitmap method Services: - Add AppInfoService, ConnectivityService, DeviceDisplayService, DeviceInfoService - Add GtkHostService, GtkContextMenuService, MauiIconGenerator Window: - Add CursorType enum and GtkHostWindow - Update X11Window with SetIcon, SetCursor methods Build: SUCCESS (0 errors) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
80
Native/CairoNative.cs
Normal file
80
Native/CairoNative.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Maui.Platform.Linux.Native;
|
||||
|
||||
internal static class CairoNative
|
||||
{
|
||||
public enum cairo_format_t
|
||||
{
|
||||
CAIRO_FORMAT_INVALID = -1,
|
||||
CAIRO_FORMAT_ARGB32,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
CAIRO_FORMAT_A8,
|
||||
CAIRO_FORMAT_A1,
|
||||
CAIRO_FORMAT_RGB16_565,
|
||||
CAIRO_FORMAT_RGB30
|
||||
}
|
||||
|
||||
private const string Lib = "libcairo.so.2";
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern IntPtr cairo_image_surface_create_for_data(IntPtr data, cairo_format_t format, int width, int height, int stride);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern IntPtr cairo_image_surface_create(cairo_format_t format, int width, int height);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern IntPtr cairo_image_surface_get_data(IntPtr surface);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern int cairo_image_surface_get_width(IntPtr surface);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern int cairo_image_surface_get_height(IntPtr surface);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern int cairo_image_surface_get_stride(IntPtr surface);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_surface_destroy(IntPtr surface);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_surface_flush(IntPtr surface);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_surface_mark_dirty(IntPtr surface);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_surface_mark_dirty_rectangle(IntPtr surface, int x, int y, int width, int height);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_set_source_surface(IntPtr cr, IntPtr surface, double x, double y);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_set_source_rgb(IntPtr cr, double red, double green, double blue);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_set_source_rgba(IntPtr cr, double red, double green, double blue, double alpha);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_paint(IntPtr cr);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_paint_with_alpha(IntPtr cr, double alpha);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_fill(IntPtr cr);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_rectangle(IntPtr cr, double x, double y, double width, double height);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_clip(IntPtr cr);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_save(IntPtr cr);
|
||||
|
||||
[DllImport("libcairo.so.2")]
|
||||
public static extern void cairo_restore(IntPtr cr);
|
||||
}
|
||||
Reference in New Issue
Block a user