/[emacs]/emacs/src/xselect.c
ViewVC logotype

Diff of /emacs/src/xselect.c

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

revision 1.107 by pj, Sun Oct 21 12:13:46 2001 UTC revision 1.108 by pj, Fri Nov 2 20:39:03 2001 UTC
# Line 304  x_own_selection (selection_name, selecti Line 304  x_own_selection (selection_name, selecti
304    struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);    struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
305    int count;    int count;
306    
307    CHECK_SYMBOL (selection_name, 0);    CHECK_SYMBOL (selection_name);
308    selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name);    selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name);
309    
310    BLOCK_INPUT;    BLOCK_INPUT;
# Line 415  x_get_local_selection (selection_symbol, Line 415  x_get_local_selection (selection_symbol,
415        count = specpdl_ptr - specpdl;        count = specpdl_ptr - specpdl;
416        specbind (Qinhibit_quit, Qt);        specbind (Qinhibit_quit, Qt);
417    
418        CHECK_SYMBOL (target_type, 0);        CHECK_SYMBOL (target_type);
419        handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));        handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
420        if (!NILP (handler_fn))        if (!NILP (handler_fn))
421          value = call3 (handler_fn,          value = call3 (handler_fn,
# Line 1173  copy_multiple_data (obj) Line 1173  copy_multiple_data (obj)
1173    if (CONSP (obj))    if (CONSP (obj))
1174      return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj)));      return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj)));
1175            
1176    CHECK_VECTOR (obj, 0);    CHECK_VECTOR (obj);
1177    vec = Fmake_vector (size = XVECTOR (obj)->size, Qnil);    vec = Fmake_vector (size = XVECTOR (obj)->size, Qnil);
1178    for (i = 0; i < size; i++)    for (i = 0; i < size; i++)
1179      {      {
1180        Lisp_Object vec2 = XVECTOR (obj)->contents [i];        Lisp_Object vec2 = XVECTOR (obj)->contents [i];
1181        CHECK_VECTOR (vec2, 0);        CHECK_VECTOR (vec2);
1182        if (XVECTOR (vec2)->size != 2)        if (XVECTOR (vec2)->size != 2)
1183          /* ??? Confusing error message */          /* ??? Confusing error message */
1184          Fsignal (Qerror, Fcons (build_string ("vectors must be of length 2"),          Fsignal (Qerror, Fcons (build_string ("vectors must be of length 2"),
# Line 1958  anything that the functions on `selectio Line 1958  anything that the functions on `selectio
1958       Lisp_Object selection_name, selection_value;       Lisp_Object selection_name, selection_value;
1959  {  {
1960    check_x ();    check_x ();
1961    CHECK_SYMBOL (selection_name, 0);    CHECK_SYMBOL (selection_name);
1962    if (NILP (selection_value)) error ("selection-value may not be nil");    if (NILP (selection_value)) error ("selection-value may not be nil");
1963    x_own_selection (selection_name, selection_value);    x_own_selection (selection_name, selection_value);
1964    return selection_value;    return selection_value;
# Line 1982  TYPE is the type of data desired, typica Line 1982  TYPE is the type of data desired, typica
1982    struct gcpro gcpro1, gcpro2;    struct gcpro gcpro1, gcpro2;
1983    GCPRO2 (target_type, val); /* we store newly consed data into these */    GCPRO2 (target_type, val); /* we store newly consed data into these */
1984    check_x ();    check_x ();
1985    CHECK_SYMBOL (selection_symbol, 0);    CHECK_SYMBOL (selection_symbol);
1986    
1987  #if 0 /* #### MULTIPLE doesn't work yet */  #if 0 /* #### MULTIPLE doesn't work yet */
1988    if (CONSP (target_type)    if (CONSP (target_type)
1989        && XCAR (target_type) == QMULTIPLE)        && XCAR (target_type) == QMULTIPLE)
1990      {      {
1991        CHECK_VECTOR (XCDR (target_type), 0);        CHECK_VECTOR (XCDR (target_type));
1992        /* So we don't destructively modify this...  */        /* So we don't destructively modify this...  */
1993        target_type = copy_multiple_data (target_type);        target_type = copy_multiple_data (target_type);
1994      }      }
1995    else    else
1996  #endif  #endif
1997      CHECK_SYMBOL (target_type, 0);      CHECK_SYMBOL (target_type);
1998    
1999    val = x_get_local_selection (selection_symbol, target_type);    val = x_get_local_selection (selection_symbol, target_type);
2000    
# Line 2035  Disowning it means there is no such sele Line 2035  Disowning it means there is no such sele
2035    check_x ();    check_x ();
2036    display = FRAME_X_DISPLAY (sf);    display = FRAME_X_DISPLAY (sf);
2037    dpyinfo = FRAME_X_DISPLAY_INFO (sf);    dpyinfo = FRAME_X_DISPLAY_INFO (sf);
2038    CHECK_SYMBOL (selection, 0);    CHECK_SYMBOL (selection);
2039    if (NILP (time))    if (NILP (time))
2040      timestamp = last_event_timestamp;      timestamp = last_event_timestamp;
2041    else    else
# Line 2096  and t is the same as `SECONDARY'.  */) Line 2096  and t is the same as `SECONDARY'.  */)
2096       Lisp_Object selection;       Lisp_Object selection;
2097  {  {
2098    check_x ();    check_x ();
2099    CHECK_SYMBOL (selection, 0);    CHECK_SYMBOL (selection);
2100    if (EQ (selection, Qnil)) selection = QPRIMARY;    if (EQ (selection, Qnil)) selection = QPRIMARY;
2101    if (EQ (selection, Qt)) selection = QSECONDARY;    if (EQ (selection, Qt)) selection = QSECONDARY;
2102        
# Line 2126  and t is the same as `SECONDARY'.  */) Line 2126  and t is the same as `SECONDARY'.  */)
2126      return Qnil;      return Qnil;
2127    
2128    dpy = FRAME_X_DISPLAY (sf);    dpy = FRAME_X_DISPLAY (sf);
2129    CHECK_SYMBOL (selection, 0);    CHECK_SYMBOL (selection);
2130    if (!NILP (Fx_selection_owner_p (selection)))    if (!NILP (Fx_selection_owner_p (selection)))
2131      return Qt;      return Qt;
2132    if (EQ (selection, Qnil)) selection = QPRIMARY;    if (EQ (selection, Qnil)) selection = QPRIMARY;
# Line 2166  initialize_cut_buffers (display, window) Line 2166  initialize_cut_buffers (display, window)
2166  }  }
2167    
2168    
2169  #define CHECK_CUT_BUFFER(symbol,n)                                      \  #define CHECK_CUT_BUFFER(symbol)                                        \
2170    { CHECK_SYMBOL ((symbol), (n));                                       \    { CHECK_SYMBOL ((symbol));                                    \
2171      if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1)      \      if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1)      \
2172          && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3)   \          && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3)   \
2173          && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5)   \          && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5)   \
# Line 2199  DEFUN ("x-get-cut-buffer-internal", Fx_g Line 2199  DEFUN ("x-get-cut-buffer-internal", Fx_g
2199    display = FRAME_X_DISPLAY (sf);    display = FRAME_X_DISPLAY (sf);
2200    dpyinfo = FRAME_X_DISPLAY_INFO (sf);    dpyinfo = FRAME_X_DISPLAY_INFO (sf);
2201    window = RootWindow (display, 0); /* Cut buffers are on screen 0 */    window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
2202    CHECK_CUT_BUFFER (buffer, 0);    CHECK_CUT_BUFFER (buffer);
2203    buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer);    buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer);
2204    
2205    x_get_window_property (display, window, buffer_atom, &data, &bytes,    x_get_window_property (display, window, buffer_atom, &data, &bytes,
# Line 2244  DEFUN ("x-store-cut-buffer-internal", Fx Line 2244  DEFUN ("x-store-cut-buffer-internal", Fx
2244    if (max_bytes > MAX_SELECTION_QUANTUM)    if (max_bytes > MAX_SELECTION_QUANTUM)
2245      max_bytes = MAX_SELECTION_QUANTUM;      max_bytes = MAX_SELECTION_QUANTUM;
2246    
2247    CHECK_CUT_BUFFER (buffer, 0);    CHECK_CUT_BUFFER (buffer);
2248    CHECK_STRING (string, 0);    CHECK_STRING (string);
2249    buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf),    buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf),
2250                                    display, buffer);                                    display, buffer);
2251    data = (unsigned char *) XSTRING (string)->data;    data = (unsigned char *) XSTRING (string)->data;
# Line 2297  Positive means shift the values forward, Line 2297  Positive means shift the values forward,
2297    check_x ();    check_x ();
2298    display = FRAME_X_DISPLAY (sf);    display = FRAME_X_DISPLAY (sf);
2299    window = RootWindow (display, 0); /* Cut buffers are on screen 0 */    window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
2300    CHECK_NUMBER (n, 0);    CHECK_NUMBER (n);
2301    if (XINT (n) == 0)    if (XINT (n) == 0)
2302      return n;      return n;
2303    if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)    if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)

Legend:
Removed from v.1.107  
changed lines
  Added in v.1.108

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