-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestxsp.c
37 lines (30 loc) · 829 Bytes
/
testxsp.c
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
#include <X11/X.h>
#include <X11/Xlib.h>
#include "Xsp.h"
#include <stdio.h>
int main (int argc, char **argv)
{
Display *dpy;
int event_base, error_base;
int major, minor;
dpy = XOpenDisplay(NULL);
if (!XSPQueryExtension(dpy, &event_base, &error_base, &major, &minor))
{
fprintf(stderr, "XSP extension not available\n");
XCloseDisplay(dpy);
return 1;
}
printf("XSP extension found:\n");
printf(" event_base: %d\n", event_base);
printf(" error_base: %d\n", error_base);
printf(" major: %d\n", major);
printf(" minor: %d\n", minor);
if (!XSPRegisterDSPArea(dpy, DefaultScreen(dpy), 0, 0, 800, 480)) {
fprintf(stderr, "XSPRegisterDSPArea failed\n");
}
if (!XSPCancelDSPArea(dpy, DefaultScreen(dpy))) {
fprintf(stderr, "XSPCancelDSPArea failed\n");
}
XCloseDisplay(dpy);
return 0;
}