63 |
static XftDraw *renderDraw; |
static XftDraw *renderDraw; |
64 |
#endif |
#endif |
65 |
#ifdef CONFIG_XV |
#ifdef CONFIG_XV |
66 |
static unsigned int xv_nb_formats, xv_nb_adaptors, xv_port, xv_format, xv_open_count; |
static unsigned int xv_nb_adaptors, xv_port, xv_format, xv_open_count; |
67 |
|
static int xv_nb_formats; |
68 |
static XvAdaptorInfo *xv_ai; |
static XvAdaptorInfo *xv_ai; |
69 |
static XvImageFormatValues *xv_fo; |
static XvImageFormatValues *xv_fo; |
70 |
#endif |
#endif |
77 |
static CSSRect update_rects[UPDATE_MAX_REGIONS]; |
static CSSRect update_rects[UPDATE_MAX_REGIONS]; |
78 |
#endif |
#endif |
79 |
|
|
80 |
extern QEDisplay x11_dpy; |
static QEDisplay x11_dpy; |
81 |
static int visual_depth; |
static int visual_depth; |
82 |
|
|
83 |
static int force_tty = 0; |
static int force_tty = 0; |
1062 |
{ |
{ |
1063 |
Window w; |
Window w; |
1064 |
Atom prop; |
Atom prop; |
1065 |
long nread, bytes_after; |
long nread; |
1066 |
unsigned char *data; |
unsigned char *data; |
1067 |
Atom actual_type; |
Atom actual_type; |
1068 |
int actual_fmt; |
int actual_fmt; |
1069 |
long nitems; |
unsigned long nitems, bytes_after; |
1070 |
EditBuffer *b; |
EditBuffer *b; |
1071 |
XEvent xev; |
XEvent xev; |
1072 |
|
|
1139 |
target_list[0] = xa_targets; |
target_list[0] = xa_targets; |
1140 |
target_list[1] = XA_STRING; |
target_list[1] = XA_STRING; |
1141 |
|
|
1142 |
XChangeProperty (display, rq->requestor, rq->property, |
XChangeProperty(display, rq->requestor, rq->property, |
1143 |
xa_targets, 8*sizeof(target_list[0]), PropModeReplace, |
xa_targets, 8*sizeof(target_list[0]), PropModeReplace, |
1144 |
(char *)target_list, |
(unsigned char *)target_list, |
1145 |
sizeof(target_list)/sizeof(target_list[0])); |
sizeof(target_list)/sizeof(target_list[0])); |
1146 |
} else if (rq->target == XA_STRING) { |
} else if (rq->target == XA_STRING) { |
1147 |
/* get qemacs yank buffer */ |
/* get qemacs yank buffer */ |
1148 |
|
|
1180 |
static void x11_handle_event(void *opaque) |
static void x11_handle_event(void *opaque) |
1181 |
{ |
{ |
1182 |
QEditScreen *s = opaque; |
QEditScreen *s = opaque; |
1183 |
unsigned char buf[16]; |
char buf[16]; |
1184 |
XEvent xev; |
XEvent xev; |
1185 |
KeySym keysym; |
KeySym keysym; |
1186 |
int shift, ctrl, meta, len, key; |
int shift, ctrl, meta, len, key; |
1294 |
goto got_key; |
goto got_key; |
1295 |
default: |
default: |
1296 |
if (len > 0) { |
if (len > 0) { |
1297 |
key = buf[0]; |
key = buf[0] & 0xff; |
1298 |
goto got_key; |
goto got_key; |
1299 |
} |
} |
1300 |
break; |
break; |
1372 |
key = utf8_decode(&p); |
key = utf8_decode(&p); |
1373 |
} |
} |
1374 |
#else |
#else |
1375 |
key = buf[0]; |
key = buf[0] & 0xff; |
1376 |
#endif |
#endif |
1377 |
got_key: |
got_key: |
1378 |
ev->key_event.type = QE_KEY_EVENT; |
ev->key_event.type = QE_KEY_EVENT; |
1619 |
ximage = XCreateImage(display, None, attr.depth, ZPixmap, 0, |
ximage = XCreateImage(display, None, attr.depth, ZPixmap, 0, |
1620 |
NULL, w1, h1, 8, 0); |
NULL, w1, h1, 8, 0); |
1621 |
ximage->data = malloc(h1 * ximage->bytes_per_line); |
ximage->data = malloc(h1 * ximage->bytes_per_line); |
1622 |
pict->data[0] = ximage->data; |
pict->data[0] = (unsigned char *)ximage->data; |
1623 |
pict->linesize[0] = ximage->bytes_per_line; |
pict->linesize[0] = ximage->bytes_per_line; |
1624 |
xb->ximage_lock = ximage; |
xb->ximage_lock = ximage; |
1625 |
xb->x_lock = x1; |
xb->x_lock = x1; |
1629 |
case BMP_XIMAGE: |
case BMP_XIMAGE: |
1630 |
case BMP_XSHMIMAGE: |
case BMP_XSHMIMAGE: |
1631 |
bpp = (xb->u.ximage->bits_per_pixel + 7) >> 3; |
bpp = (xb->u.ximage->bits_per_pixel + 7) >> 3; |
1632 |
pict->data[0] = xb->u.ximage->data + |
pict->data[0] = (unsigned char *)xb->u.ximage->data + |
1633 |
y1 * xb->u.ximage->bytes_per_line + x1 * bpp; |
y1 * xb->u.ximage->bytes_per_line + x1 * bpp; |
1634 |
pict->linesize[0] = xb->u.ximage->bytes_per_line; |
pict->linesize[0] = xb->u.ximage->bytes_per_line; |
1635 |
break; |
break; |
1636 |
#ifdef CONFIG_XV |
#ifdef CONFIG_XV |
1649 |
yy >>= 1; |
yy >>= 1; |
1650 |
j = 3 - i; /* don't know why they inverted Cb and Cr! */ |
j = 3 - i; /* don't know why they inverted Cb and Cr! */ |
1651 |
} |
} |
1652 |
pict->data[j] = xvimage->data + xvimage->offsets[i] + |
pict->data[j] = (unsigned char *)xvimage->data + |
1653 |
yy * xvimage->pitches[i] + xx; |
xvimage->offsets[i] + |
1654 |
|
yy * xvimage->pitches[i] + xx; |
1655 |
pict->linesize[j] = xvimage->pitches[i]; |
pict->linesize[j] = xvimage->pitches[i]; |
1656 |
} |
} |
1657 |
} |
} |