/[qemacs]/qemacs/x11.c
ViewVC logotype

Diff of /qemacs/x11.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by chqrlie, Fri May 13 10:05:24 2005 UTC revision 1.7 by chqrlie, Fri Jul 8 09:30:44 2005 UTC
# Line 63  static int shm_use; Line 63  static int shm_use;
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
# Line 76  static int update_nb; Line 77  static int update_nb;
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;
# Line 1061  static void term_selection_request(QEdit Line 1062  static void term_selection_request(QEdit
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    
# Line 1138  static void selection_send(XSelectionReq Line 1139  static void selection_send(XSelectionReq
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                
# Line 1179  static int x11_is_user_input_pending(QEd Line 1180  static int x11_is_user_input_pending(QEd
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;
# Line 1293  static void x11_handle_event(void *opaqu Line 1294  static void x11_handle_event(void *opaqu
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;
# Line 1371  static void x11_handle_event(void *opaqu Line 1372  static void x11_handle_event(void *opaqu
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;
# Line 1618  static void x11_bmp_lock(QEditScreen *s, Line 1619  static void x11_bmp_lock(QEditScreen *s,
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;
# Line 1628  static void x11_bmp_lock(QEditScreen *s, Line 1629  static void x11_bmp_lock(QEditScreen *s,
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
# Line 1648  static void x11_bmp_lock(QEditScreen *s, Line 1649  static void x11_bmp_lock(QEditScreen *s,
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          }          }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26