summaryrefslogtreecommitdiffstats
path: root/Tests/X11/X11.c
blob: 8ec6adc0d5091399ab82aba236588c15edc94368 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifdef CMAKE_HAS_X

#include <X11/Xlib.h>
#include <X11/Xutil.h>

char hello[]="hello.world";
char hi[]="Hi";

main(argc, argv)
int argc;
char **argv;
{
  Display *mydisplay;
  Window  mywindow;
  GC mygc;

  XEvent myevent;
  KeySym mykey;

  XSizeHints myhint;
  int myscreen;
  unsigned long myforeground, mybackground;
  int i;
  char text[10];
  int done;
  char* display = ":0";


  if ( getenv("DISPLAY") )
    {
    display = getenv("DISPLAY");
    }

  mydisplay=XOpenDisplay(display);
  if ( mydisplay )
    {
    printf("Opened...\n");
    XCloseDisplay(mydisplay);
    }
  exit(0);
}


#else

#include "stdio.h"

int main()
{
  printf("No X on this computer\n");
  return 0;
}

#endif