GdkSharp
| GdkSharp | |
|---|---|
| Developer(s) | GNOME Project, Xamarin, and community contributors |
| Initial release |
2002 |
| Latest version | — |
| Programming language | C# |
| Operating system | Cross-platform |
| Platform | .NET, Mono |
| Type | GUI toolkit bindings |
| License | GNU Lesser General Public License |
| Website | GitHub repository |
GdkSharp is a set of C# bindings for the GDK library, which forms the low-level drawing and windowing layer of the GTK toolkit.
It is part of the broader GtkSharp project, which provides .NET and Mono bindings for the GNOME platform libraries.
Overview of GDK
GDK (GIMP Drawing Kit) is a low-level library used by GTK for drawing graphics, handling windows, managing input devices, and interfacing with the underlying windowing systems (such as X11, Wayland, or Windows’ GDI). GDK provides a platform abstraction layer that allows GTK applications to run across different operating systems without modification.
Key features of GDK include:
- Window and surface management
- Drawing primitives and rendering via Cairo
- Input event handling (keyboard, mouse, touch)
- Integration with display servers and graphics backends
GdkSharp
GdkSharp provides managed .NET bindings for the native GDK library. It allows developers to interact with GDK objects (such as windows, displays, cursors, and drawing contexts) from within C# or other .NET languages.
Through GdkSharp, developers can:
- Access low-level graphics surfaces and windows
- Handle user input events in a cross-platform way
- Integrate custom rendering with GTK widgets
- Manage monitors, screens, and display connections
While most GTK application developers interact mainly with GTK widgets, advanced users can leverage GdkSharp for direct control over rendering and input handling.
Relationship to other GtkSharp components
GdkSharp works closely with other bindings in the GtkSharp ecosystem:
- GtkSharp – The main user interface toolkit built on top of GDK.
- CairoSharp – Provides bindings for the Cairo 2D graphics library used for drawing within GDK surfaces.
- GLibSharp – Supplies the fundamental data types and event loop system on which both GTK and GDK depend.
Version compatibility
GdkSharp versions correspond to their GTK counterparts:
- **GdkSharp 2.x** – For GTK 2
- **GdkSharp 3.x** – For GTK 3 (current stable bindings)
- **GdkSharp 4.x** – In development for GTK 4 and modern .NET runtimes
