Как написать графическую программу на mono без X-сервера

Разработка на C# под linux
 
http://stackoverflow.com/questions/12135300/how-to-access-a-linux-framebuffer-in-mono-mono-cairo-gtk

Что такое Cairo?
Что общего у Mono.Cairo и Gtk# ?

SVGAlib

SVGAlib is an open-source low-level graphics library
which runs on Linux and FreeBSD and allows programs to change video mode and display full-screen graphics.
The library was popular in mid-1990s.
Toward 2000, many applications that used it migrated to X11 and SDL, which itself can make use of SVGAlib as a video driver.

Framebuffer

https://en.wikipedia.org/wiki/Linux_framebuffer
The Linux framebuffer (fbdev) is a graphic hardware-independent abstraction layer to show graphics on a computer monitor
a part of video memory containing a current video frame, and the Linux framebuffer means "Access method to the framebuffer under the Linux kernel"
without relying on system-specific libraries such as SVGALib or another user space software.

several Linux programs such as MPlayer, links2, Netsurf, fbida and libraries such as GGI, SDL, GTK+ and Qt Extended can use the framebuffer directly.

SDL, zlib lincense

Initial release 1998; 17 years ago
https://en.wikipedia.org/wiki/Simple_DirectMedia_Layer
cross-platform software development library designed to provide a low level hardware abstraction layer to computer multimedia hardware components.
manages video, audio, input devices, CD-ROM, threads, shared object loading, networking and timers
SDL can be used instead of XInput and XAudio2.

SDL is a wrapper around the operating-system-specific functions game engines needs to access. The only purpose of SDL is to provide a common framework for accessing these functions for multiple operating systems (cross-platform).

Under the zlib License, SDL 2.0 is freely available for static linking in closed-source projects
SDL 2.0 is a major update to the SDL 1.2 codebase with a different, not backwards-compatible API
multiple window support, hardware-accelerated 2D graphics, and better Unicode support.
Support for Mir and Wayland is available since SDL 2.0.2 (but still disabled by default).

C# bindings - https://github.com/flibitijibibo/SDL2-CS

examples are
open source - Freeciv, OpenTTD, The Battle for Wesnoth.
commercial - Angry Birds, Unreal Tournament

DirectFB, LGPL

https://en.wikipedia.org/wiki/DirectFB
support for translucent windows and multiple display layers on top of the Linux framebuffer without requiring any kernel modifications.

In 2006, a version of DirectFB was included in the software stack for the CE Linux Forum's Audio/Video Graphics Specification V2

Xvfb

Xvfb provides an X server that can run on machines with no display hardware and no physical input devices.
It emulates a dumb framebuffer using virtual memory.

- doing batch processing with Xvfb as a background rendering engine
- providing an unobtrusive way to run applications that don't really need an X server but insist on having one anyway.
- testing clients against unusual depths and screen configurations
- load testing, as an aid to porting the X server to a new platform

contains a convenience script called xvfb-run which simplifies the automated execution of X clients
in a virtual server environment. This convenience script requires the use of the xauth program.

http://superuser.com/questions/624918/how-to-run-gtk-app-on-linux-without-an-x-server
Xvfb :1 &
export DISPLAY=:1
./runMyApp &

XDirectFB

DirectFB can host XDirectFB, a rootless X server implementation that uses DirectFB windows for X11 top-level windows.
XDirectFB is an interface that mimics the X11 interface through the DirectFB API to simplify running applications written for X11 on DirectFB

DirectFBGL is an OpenGL extension for DirectFB/XDirectFB
that uses Direct Rendering Infrastructure (DRI) in the Mesa 3D library to support OpenGL hardware acceleration.

Xephyr

https://en.wikipedia.org/wiki/Xephyr

Xephyr is a display server implementing the X11 display server protocol based on KDrive which targets a window on a host X Server
KDrive - one of XOrg implementations.

Xephyr is an X-on-X implementation. Since version 1.16.0, Xephyr serves as the primary development environment for the new 2D acceleration subsystem (Glamor), permitting rapid development and testing on a single machine

Что он делает, зачем он нужен, как используется в Qubes OS?

Cairo

Cairo (graphics), a free software vector graphics library
the idea of a cross-platform library to access display server, not tied to the X Window System.
https://en.wikipedia.org/wiki/Cairo_(graphics)

Cairo supports output to a number of different back-ends, known as "surfaces" in its code.
- X Window System, via both Xlib and XCB
- OpenGL contexts (directly and via glitz)
- local image buffers, PNG files, PDF, PostScript, DirectFB and SVG files.

Cairo on framebuffer

http://lists.cairographics.org/archives/cairo/2010-July/020378.html
http://cairo.cairographics.narkive.com/JSE33zWp/frame-buffer-and-special-pixel-formats

Cairo on Wayland?

Gtk

http://www.gtk.org/api/2.6/gtk/gtk-framebuffer.html
GTK+ has not only full support for cairo, but
starting in 2005 with version 2.8, uses cairo to render the majority of its graphical control elements, and
since 3.0 all rendering is done through cairo.

GtkFB libraries

Mono

The Mono Project, including Moonlight, has been using cairo since very early
in conception to power the backends of its GDI+ (libgdiplus) and System.Drawing namespaces.

Mono.Cairo library exposes a DirectFBSurface type,
however the constructor for that surface takes two IntPtr arguments and is not documented
you need to pass a pointer to a native IDirectFB and a IDirectFBSurface.
http://cgit.freedesktop.org/cairo/tree/src/cairo-directfb-surface.c#n499
https://github.com/mono/mono/blob/master/mcs/class/Mono.Cairo/Mono.Cairo/DirectFBSurface.cs

The EntryPointNotFoundException you get, means that the symbol cairo_directfb_surface_create with (IntPtr, IntPtr) as arguments was not found in your libcairo.so.2
This can likely be the case, if directfb was not enabled at compile time in cairo.
You can check for directfb support in cairo by doing:
readelf -Ws /usr/lib/libcairo.so.2 | grep directfb
If the result (output) is empty, you lack directfb support. In this case you must recompile cairo with --enable-directfb argument passed to the configure script.

The GTK# libraries all bind explicitly to the X11 interface