26 #if defined (HAVE_CONFIG_H)
32 #if defined (OCTAVE_USE_WINDOWS_API)
34 #elif defined (HAVE_FRAMEWORK_CARBON)
35 # include <Carbon/Carbon.h>
36 #elif defined (HAVE_X_WINDOWS)
37 # include <X11/Xlib.h>
47 const char *err_msg =
"";
49 #if defined (OCTAVE_USE_WINDOWS_API)
56 err_msg =
"no graphical display found";
58 #elif defined (HAVE_FRAMEWORK_CARBON)
60 CGDirectDisplayID display = CGMainDisplayID ();
65 err_msg =
"no graphical display found";
67 #elif defined (HAVE_X_WINDOWS)
69 const char *display_name = getenv (
"DISPLAY");
71 if (display_name && *display_name)
73 Display *display = XOpenDisplay (display_name);
77 Screen *screen = DefaultScreenOfDisplay (display);
80 err_msg =
"X11 display has no default screen";
82 XCloseDisplay (display);
87 err_msg =
"unable to open X11 DISPLAY";
90 err_msg =
"X11 DISPLAY environment variable not set";
94 err_msg =
"no graphical display found";
const char * display_available(int *dpy_avail)