comparison src/xselect.c @ 40656:cdfd4d09b79a

Update usage of CHECK_ macros (remove unused second argument).
author Pavel Jan?k <Pavel@Janik.cz>
date Fri, 02 Nov 2001 20:46:55 +0000
parents e528f2adeed4
children 0ccb9431ca7b
comparison
equal deleted inserted replaced
40655:45453187feeb 40656:cdfd4d09b79a
302 Time time = last_event_timestamp; 302 Time time = last_event_timestamp;
303 Atom selection_atom; 303 Atom selection_atom;
304 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf); 304 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
305 int count; 305 int count;
306 306
307 CHECK_SYMBOL (selection_name, 0); 307 CHECK_SYMBOL (selection_name);
308 selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name); 308 selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name);
309 309
310 BLOCK_INPUT; 310 BLOCK_INPUT;
311 count = x_catch_errors (display); 311 count = x_catch_errors (display);
312 XSetSelectionOwner (display, selection_atom, selecting_window, time); 312 XSetSelectionOwner (display, selection_atom, selecting_window, time);
413 When the user types C-g, he would be surprised 413 When the user types C-g, he would be surprised
414 if by luck it came during a converter. */ 414 if by luck it came during a converter. */
415 count = specpdl_ptr - specpdl; 415 count = specpdl_ptr - specpdl;
416 specbind (Qinhibit_quit, Qt); 416 specbind (Qinhibit_quit, Qt);
417 417
418 CHECK_SYMBOL (target_type, 0); 418 CHECK_SYMBOL (target_type);
419 handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist)); 419 handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
420 if (!NILP (handler_fn)) 420 if (!NILP (handler_fn))
421 value = call3 (handler_fn, 421 value = call3 (handler_fn,
422 selection_symbol, target_type, 422 selection_symbol, target_type,
423 XCAR (XCDR (local_value))); 423 XCAR (XCDR (local_value)));
1171 int i; 1171 int i;
1172 int size; 1172 int size;
1173 if (CONSP (obj)) 1173 if (CONSP (obj))
1174 return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj))); 1174 return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj)));
1175 1175
1176 CHECK_VECTOR (obj, 0); 1176 CHECK_VECTOR (obj);
1177 vec = Fmake_vector (size = XVECTOR (obj)->size, Qnil); 1177 vec = Fmake_vector (size = XVECTOR (obj)->size, Qnil);
1178 for (i = 0; i < size; i++) 1178 for (i = 0; i < size; i++)
1179 { 1179 {
1180 Lisp_Object vec2 = XVECTOR (obj)->contents [i]; 1180 Lisp_Object vec2 = XVECTOR (obj)->contents [i];
1181 CHECK_VECTOR (vec2, 0); 1181 CHECK_VECTOR (vec2);
1182 if (XVECTOR (vec2)->size != 2) 1182 if (XVECTOR (vec2)->size != 2)
1183 /* ??? Confusing error message */ 1183 /* ??? Confusing error message */
1184 Fsignal (Qerror, Fcons (build_string ("vectors must be of length 2"), 1184 Fsignal (Qerror, Fcons (build_string ("vectors must be of length 2"),
1185 Fcons (vec2, Qnil))); 1185 Fcons (vec2, Qnil)));
1186 XVECTOR (vec)->contents [i] = Fmake_vector (2, Qnil); 1186 XVECTOR (vec)->contents [i] = Fmake_vector (2, Qnil);
1956 anything that the functions on `selection-converter-alist' know about. */) 1956 anything that the functions on `selection-converter-alist' know about. */)
1957 (selection_name, selection_value) 1957 (selection_name, selection_value)
1958 Lisp_Object selection_name, selection_value; 1958 Lisp_Object selection_name, selection_value;
1959 { 1959 {
1960 check_x (); 1960 check_x ();
1961 CHECK_SYMBOL (selection_name, 0); 1961 CHECK_SYMBOL (selection_name);
1962 if (NILP (selection_value)) error ("selection-value may not be nil"); 1962 if (NILP (selection_value)) error ("selection-value may not be nil");
1963 x_own_selection (selection_name, selection_value); 1963 x_own_selection (selection_name, selection_value);
1964 return selection_value; 1964 return selection_value;
1965 } 1965 }
1966 1966
1980 { 1980 {
1981 Lisp_Object val = Qnil; 1981 Lisp_Object val = Qnil;
1982 struct gcpro gcpro1, gcpro2; 1982 struct gcpro gcpro1, gcpro2;
1983 GCPRO2 (target_type, val); /* we store newly consed data into these */ 1983 GCPRO2 (target_type, val); /* we store newly consed data into these */
1984 check_x (); 1984 check_x ();
1985 CHECK_SYMBOL (selection_symbol, 0); 1985 CHECK_SYMBOL (selection_symbol);
1986 1986
1987 #if 0 /* #### MULTIPLE doesn't work yet */ 1987 #if 0 /* #### MULTIPLE doesn't work yet */
1988 if (CONSP (target_type) 1988 if (CONSP (target_type)
1989 && XCAR (target_type) == QMULTIPLE) 1989 && XCAR (target_type) == QMULTIPLE)
1990 { 1990 {
1991 CHECK_VECTOR (XCDR (target_type), 0); 1991 CHECK_VECTOR (XCDR (target_type));
1992 /* So we don't destructively modify this... */ 1992 /* So we don't destructively modify this... */
1993 target_type = copy_multiple_data (target_type); 1993 target_type = copy_multiple_data (target_type);
1994 } 1994 }
1995 else 1995 else
1996 #endif 1996 #endif
1997 CHECK_SYMBOL (target_type, 0); 1997 CHECK_SYMBOL (target_type);
1998 1998
1999 val = x_get_local_selection (selection_symbol, target_type); 1999 val = x_get_local_selection (selection_symbol, target_type);
2000 2000
2001 if (NILP (val)) 2001 if (NILP (val))
2002 { 2002 {
2033 struct frame *sf = SELECTED_FRAME (); 2033 struct frame *sf = SELECTED_FRAME ();
2034 2034
2035 check_x (); 2035 check_x ();
2036 display = FRAME_X_DISPLAY (sf); 2036 display = FRAME_X_DISPLAY (sf);
2037 dpyinfo = FRAME_X_DISPLAY_INFO (sf); 2037 dpyinfo = FRAME_X_DISPLAY_INFO (sf);
2038 CHECK_SYMBOL (selection, 0); 2038 CHECK_SYMBOL (selection);
2039 if (NILP (time)) 2039 if (NILP (time))
2040 timestamp = last_event_timestamp; 2040 timestamp = last_event_timestamp;
2041 else 2041 else
2042 timestamp = cons_to_long (time); 2042 timestamp = cons_to_long (time);
2043 2043
2094 and t is the same as `SECONDARY'. */) 2094 and t is the same as `SECONDARY'. */)
2095 (selection) 2095 (selection)
2096 Lisp_Object selection; 2096 Lisp_Object selection;
2097 { 2097 {
2098 check_x (); 2098 check_x ();
2099 CHECK_SYMBOL (selection, 0); 2099 CHECK_SYMBOL (selection);
2100 if (EQ (selection, Qnil)) selection = QPRIMARY; 2100 if (EQ (selection, Qnil)) selection = QPRIMARY;
2101 if (EQ (selection, Qt)) selection = QSECONDARY; 2101 if (EQ (selection, Qt)) selection = QSECONDARY;
2102 2102
2103 if (NILP (Fassq (selection, Vselection_alist))) 2103 if (NILP (Fassq (selection, Vselection_alist)))
2104 return Qnil; 2104 return Qnil;
2124 /* It should be safe to call this before we have an X frame. */ 2124 /* It should be safe to call this before we have an X frame. */
2125 if (! FRAME_X_P (sf)) 2125 if (! FRAME_X_P (sf))
2126 return Qnil; 2126 return Qnil;
2127 2127
2128 dpy = FRAME_X_DISPLAY (sf); 2128 dpy = FRAME_X_DISPLAY (sf);
2129 CHECK_SYMBOL (selection, 0); 2129 CHECK_SYMBOL (selection);
2130 if (!NILP (Fx_selection_owner_p (selection))) 2130 if (!NILP (Fx_selection_owner_p (selection)))
2131 return Qt; 2131 return Qt;
2132 if (EQ (selection, Qnil)) selection = QPRIMARY; 2132 if (EQ (selection, Qnil)) selection = QPRIMARY;
2133 if (EQ (selection, Qt)) selection = QSECONDARY; 2133 if (EQ (selection, Qt)) selection = QSECONDARY;
2134 atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), dpy, selection); 2134 atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), dpy, selection);
2164 #undef FROB 2164 #undef FROB
2165 UNBLOCK_INPUT; 2165 UNBLOCK_INPUT;
2166 } 2166 }
2167 2167
2168 2168
2169 #define CHECK_CUT_BUFFER(symbol,n) \ 2169 #define CHECK_CUT_BUFFER(symbol) \
2170 { CHECK_SYMBOL ((symbol), (n)); \ 2170 { CHECK_SYMBOL ((symbol)); \
2171 if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1) \ 2171 if (!EQ((symbol), QCUT_BUFFER0) && !EQ((symbol), QCUT_BUFFER1) \
2172 && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3) \ 2172 && !EQ((symbol), QCUT_BUFFER2) && !EQ((symbol), QCUT_BUFFER3) \
2173 && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5) \ 2173 && !EQ((symbol), QCUT_BUFFER4) && !EQ((symbol), QCUT_BUFFER5) \
2174 && !EQ((symbol), QCUT_BUFFER6) && !EQ((symbol), QCUT_BUFFER7)) \ 2174 && !EQ((symbol), QCUT_BUFFER6) && !EQ((symbol), QCUT_BUFFER7)) \
2175 Fsignal (Qerror, \ 2175 Fsignal (Qerror, \
2197 2197
2198 check_x (); 2198 check_x ();
2199 display = FRAME_X_DISPLAY (sf); 2199 display = FRAME_X_DISPLAY (sf);
2200 dpyinfo = FRAME_X_DISPLAY_INFO (sf); 2200 dpyinfo = FRAME_X_DISPLAY_INFO (sf);
2201 window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ 2201 window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
2202 CHECK_CUT_BUFFER (buffer, 0); 2202 CHECK_CUT_BUFFER (buffer);
2203 buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer); 2203 buffer_atom = symbol_to_x_atom (dpyinfo, display, buffer);
2204 2204
2205 x_get_window_property (display, window, buffer_atom, &data, &bytes, 2205 x_get_window_property (display, window, buffer_atom, &data, &bytes,
2206 &type, &format, &size, 0); 2206 &type, &format, &size, 0);
2207 if (!data || !format) 2207 if (!data || !format)
2242 2242
2243 max_bytes = SELECTION_QUANTUM (display); 2243 max_bytes = SELECTION_QUANTUM (display);
2244 if (max_bytes > MAX_SELECTION_QUANTUM) 2244 if (max_bytes > MAX_SELECTION_QUANTUM)
2245 max_bytes = MAX_SELECTION_QUANTUM; 2245 max_bytes = MAX_SELECTION_QUANTUM;
2246 2246
2247 CHECK_CUT_BUFFER (buffer, 0); 2247 CHECK_CUT_BUFFER (buffer);
2248 CHECK_STRING (string, 0); 2248 CHECK_STRING (string);
2249 buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), 2249 buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf),
2250 display, buffer); 2250 display, buffer);
2251 data = (unsigned char *) XSTRING (string)->data; 2251 data = (unsigned char *) XSTRING (string)->data;
2252 bytes = STRING_BYTES (XSTRING (string)); 2252 bytes = STRING_BYTES (XSTRING (string));
2253 bytes_remaining = bytes; 2253 bytes_remaining = bytes;
2295 struct frame *sf = SELECTED_FRAME (); 2295 struct frame *sf = SELECTED_FRAME ();
2296 2296
2297 check_x (); 2297 check_x ();
2298 display = FRAME_X_DISPLAY (sf); 2298 display = FRAME_X_DISPLAY (sf);
2299 window = RootWindow (display, 0); /* Cut buffers are on screen 0 */ 2299 window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
2300 CHECK_NUMBER (n, 0); 2300 CHECK_NUMBER (n);
2301 if (XINT (n) == 0) 2301 if (XINT (n) == 0)
2302 return n; 2302 return n;
2303 if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized) 2303 if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)
2304 { 2304 {
2305 initialize_cut_buffers (display, window); 2305 initialize_cut_buffers (display, window);