Mercurial > emacs
comparison src/xselect.c @ 109351:c8a969d13eda
merge trunk
| author | Kenichi Handa <handa@etlken> |
|---|---|
| date | Fri, 09 Jul 2010 15:55:27 +0900 |
| parents | 8cfee7d2955f |
| children | 89a16701cde1 |
comparison
equal
deleted
inserted
replaced
| 109350:c11d07f3d731 | 109351:c8a969d13eda |
|---|---|
| 2092 doc: /* Assert an X selection of the given TYPE with the given VALUE. | 2092 doc: /* Assert an X selection of the given TYPE with the given VALUE. |
| 2093 TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 2093 TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. |
| 2094 \(Those are literal upper-case symbol names, since that's what X expects.) | 2094 \(Those are literal upper-case symbol names, since that's what X expects.) |
| 2095 VALUE is typically a string, or a cons of two markers, but may be | 2095 VALUE is typically a string, or a cons of two markers, but may be |
| 2096 anything that the functions on `selection-converter-alist' know about. */) | 2096 anything that the functions on `selection-converter-alist' know about. */) |
| 2097 (selection_name, selection_value) | 2097 (Lisp_Object selection_name, Lisp_Object selection_value) |
| 2098 Lisp_Object selection_name, selection_value; | |
| 2099 { | 2098 { |
| 2100 check_x (); | 2099 check_x (); |
| 2101 CHECK_SYMBOL (selection_name); | 2100 CHECK_SYMBOL (selection_name); |
| 2102 if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil"); | 2101 if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil"); |
| 2103 x_own_selection (selection_name, selection_value); | 2102 x_own_selection (selection_name, selection_value); |
| 2115 SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 2114 SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. |
| 2116 \(Those are literal upper-case symbol names, since that's what X expects.) | 2115 \(Those are literal upper-case symbol names, since that's what X expects.) |
| 2117 TYPE is the type of data desired, typically `STRING'. | 2116 TYPE is the type of data desired, typically `STRING'. |
| 2118 TIME_STAMP is the time to use in the XConvertSelection call for foreign | 2117 TIME_STAMP is the time to use in the XConvertSelection call for foreign |
| 2119 selections. If omitted, defaults to the time for the last event. */) | 2118 selections. If omitted, defaults to the time for the last event. */) |
| 2120 (selection_symbol, target_type, time_stamp) | 2119 (Lisp_Object selection_symbol, Lisp_Object target_type, Lisp_Object time_stamp) |
| 2121 Lisp_Object selection_symbol, target_type, time_stamp; | |
| 2122 { | 2120 { |
| 2123 Lisp_Object val = Qnil; | 2121 Lisp_Object val = Qnil; |
| 2124 struct gcpro gcpro1, gcpro2; | 2122 struct gcpro gcpro1, gcpro2; |
| 2125 GCPRO2 (target_type, val); /* we store newly consed data into these */ | 2123 GCPRO2 (target_type, val); /* we store newly consed data into these */ |
| 2126 check_x (); | 2124 check_x (); |
| 2161 | 2159 |
| 2162 DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, | 2160 DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, |
| 2163 Sx_disown_selection_internal, 1, 2, 0, | 2161 Sx_disown_selection_internal, 1, 2, 0, |
| 2164 doc: /* If we own the selection SELECTION, disown it. | 2162 doc: /* If we own the selection SELECTION, disown it. |
| 2165 Disowning it means there is no such selection. */) | 2163 Disowning it means there is no such selection. */) |
| 2166 (selection, time) | 2164 (Lisp_Object selection, Lisp_Object time) |
| 2167 Lisp_Object selection; | |
| 2168 Lisp_Object time; | |
| 2169 { | 2165 { |
| 2170 Time timestamp; | 2166 Time timestamp; |
| 2171 Atom selection_atom; | 2167 Atom selection_atom; |
| 2172 union { | 2168 union { |
| 2173 struct selection_input_event sie; | 2169 struct selection_input_event sie; |
| 2237 The arg should be the name of the selection in question, typically one of | 2233 The arg should be the name of the selection in question, typically one of |
| 2238 the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 2234 the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. |
| 2239 \(Those are literal upper-case symbol names, since that's what X expects.) | 2235 \(Those are literal upper-case symbol names, since that's what X expects.) |
| 2240 For convenience, the symbol nil is the same as `PRIMARY', | 2236 For convenience, the symbol nil is the same as `PRIMARY', |
| 2241 and t is the same as `SECONDARY'. */) | 2237 and t is the same as `SECONDARY'. */) |
| 2242 (selection) | 2238 (Lisp_Object selection) |
| 2243 Lisp_Object selection; | |
| 2244 { | 2239 { |
| 2245 check_x (); | 2240 check_x (); |
| 2246 CHECK_SYMBOL (selection); | 2241 CHECK_SYMBOL (selection); |
| 2247 if (EQ (selection, Qnil)) selection = QPRIMARY; | 2242 if (EQ (selection, Qnil)) selection = QPRIMARY; |
| 2248 if (EQ (selection, Qt)) selection = QSECONDARY; | 2243 if (EQ (selection, Qt)) selection = QSECONDARY; |
| 2258 The arg should be the name of the selection in question, typically one of | 2253 The arg should be the name of the selection in question, typically one of |
| 2259 the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 2254 the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. |
| 2260 \(Those are literal upper-case symbol names, since that's what X expects.) | 2255 \(Those are literal upper-case symbol names, since that's what X expects.) |
| 2261 For convenience, the symbol nil is the same as `PRIMARY', | 2256 For convenience, the symbol nil is the same as `PRIMARY', |
| 2262 and t is the same as `SECONDARY'. */) | 2257 and t is the same as `SECONDARY'. */) |
| 2263 (selection) | 2258 (Lisp_Object selection) |
| 2264 Lisp_Object selection; | |
| 2265 { | 2259 { |
| 2266 Window owner; | 2260 Window owner; |
| 2267 Atom atom; | 2261 Atom atom; |
| 2268 Display *dpy; | 2262 Display *dpy; |
| 2269 struct frame *sf = SELECTED_FRAME (); | 2263 struct frame *sf = SELECTED_FRAME (); |
| 2321 } while (0) | 2315 } while (0) |
| 2322 | 2316 |
| 2323 DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, | 2317 DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, |
| 2324 Sx_get_cut_buffer_internal, 1, 1, 0, | 2318 Sx_get_cut_buffer_internal, 1, 1, 0, |
| 2325 doc: /* Returns the value of the named cut buffer (typically CUT_BUFFER0). */) | 2319 doc: /* Returns the value of the named cut buffer (typically CUT_BUFFER0). */) |
| 2326 (buffer) | 2320 (Lisp_Object buffer) |
| 2327 Lisp_Object buffer; | |
| 2328 { | 2321 { |
| 2329 Window window; | 2322 Window window; |
| 2330 Atom buffer_atom; | 2323 Atom buffer_atom; |
| 2331 unsigned char *data = NULL; | 2324 unsigned char *data = NULL; |
| 2332 int bytes; | 2325 int bytes; |
| 2372 | 2365 |
| 2373 | 2366 |
| 2374 DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, | 2367 DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, |
| 2375 Sx_store_cut_buffer_internal, 2, 2, 0, | 2368 Sx_store_cut_buffer_internal, 2, 2, 0, |
| 2376 doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */) | 2369 doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */) |
| 2377 (buffer, string) | 2370 (Lisp_Object buffer, Lisp_Object string) |
| 2378 Lisp_Object buffer, string; | |
| 2379 { | 2371 { |
| 2380 Window window; | 2372 Window window; |
| 2381 Atom buffer_atom; | 2373 Atom buffer_atom; |
| 2382 unsigned char *data; | 2374 unsigned char *data; |
| 2383 int bytes; | 2375 int bytes; |
| 2438 | 2430 |
| 2439 DEFUN ("x-rotate-cut-buffers-internal", Fx_rotate_cut_buffers_internal, | 2431 DEFUN ("x-rotate-cut-buffers-internal", Fx_rotate_cut_buffers_internal, |
| 2440 Sx_rotate_cut_buffers_internal, 1, 1, 0, | 2432 Sx_rotate_cut_buffers_internal, 1, 1, 0, |
| 2441 doc: /* Rotate the values of the cut buffers by N steps. | 2433 doc: /* Rotate the values of the cut buffers by N steps. |
| 2442 Positive N means shift the values forward, negative means backward. */) | 2434 Positive N means shift the values forward, negative means backward. */) |
| 2443 (n) | 2435 (Lisp_Object n) |
| 2444 Lisp_Object n; | |
| 2445 { | 2436 { |
| 2446 Window window; | 2437 Window window; |
| 2447 Atom props[8]; | 2438 Atom props[8]; |
| 2448 Display *display; | 2439 Display *display; |
| 2449 struct frame *sf = SELECTED_FRAME (); | 2440 struct frame *sf = SELECTED_FRAME (); |
| 2622 VALUE may be a number or a cons where the car is the upper 16 bits and | 2613 VALUE may be a number or a cons where the car is the upper 16 bits and |
| 2623 the cdr is the lower 16 bits of a 32 bit value. | 2614 the cdr is the lower 16 bits of a 32 bit value. |
| 2624 Use the display for FRAME or the current frame if FRAME is not given or nil. | 2615 Use the display for FRAME or the current frame if FRAME is not given or nil. |
| 2625 | 2616 |
| 2626 If the value is 0 or the atom is not known, return the empty string. */) | 2617 If the value is 0 or the atom is not known, return the empty string. */) |
| 2627 (value, frame) | 2618 (Lisp_Object value, Lisp_Object frame) |
| 2628 Lisp_Object value, frame; | |
| 2629 { | 2619 { |
| 2630 struct frame *f = check_x_frame (frame); | 2620 struct frame *f = check_x_frame (frame); |
| 2631 char *name = 0; | 2621 char *name = 0; |
| 2632 Lisp_Object ret = Qnil; | 2622 Lisp_Object ret = Qnil; |
| 2633 Display *dpy = FRAME_X_DISPLAY (f); | 2623 Display *dpy = FRAME_X_DISPLAY (f); |
| 2663 DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom, | 2653 DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom, |
| 2664 Sx_register_dnd_atom, 1, 2, 0, | 2654 Sx_register_dnd_atom, 1, 2, 0, |
| 2665 doc: /* Request that dnd events are made for ClientMessages with ATOM. | 2655 doc: /* Request that dnd events are made for ClientMessages with ATOM. |
| 2666 ATOM can be a symbol or a string. The ATOM is interned on the display that | 2656 ATOM can be a symbol or a string. The ATOM is interned on the display that |
| 2667 FRAME is on. If FRAME is nil, the selected frame is used. */) | 2657 FRAME is on. If FRAME is nil, the selected frame is used. */) |
| 2668 (atom, frame) | 2658 (Lisp_Object atom, Lisp_Object frame) |
| 2669 Lisp_Object atom, frame; | |
| 2670 { | 2659 { |
| 2671 Atom x_atom; | 2660 Atom x_atom; |
| 2672 struct frame *f = check_x_frame (frame); | 2661 struct frame *f = check_x_frame (frame); |
| 2673 size_t i; | 2662 size_t i; |
| 2674 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 2663 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 2781 to send. If a value is a string, it is converted to an Atom and the value of | 2770 to send. If a value is a string, it is converted to an Atom and the value of |
| 2782 the Atom is sent. If a value is a cons, it is converted to a 32 bit number | 2771 the Atom is sent. If a value is a cons, it is converted to a 32 bit number |
| 2783 with the high 16 bits from the car and the lower 16 bit from the cdr. | 2772 with the high 16 bits from the car and the lower 16 bit from the cdr. |
| 2784 If more values than fits into the event is given, the excessive values | 2773 If more values than fits into the event is given, the excessive values |
| 2785 are ignored. */) | 2774 are ignored. */) |
| 2786 (display, dest, from, message_type, format, values) | 2775 (Lisp_Object display, Lisp_Object dest, Lisp_Object from, Lisp_Object message_type, Lisp_Object format, Lisp_Object values) |
| 2787 Lisp_Object display, dest, from, message_type, format, values; | |
| 2788 { | 2776 { |
| 2789 struct x_display_info *dpyinfo = check_x_display_info (display); | 2777 struct x_display_info *dpyinfo = check_x_display_info (display); |
| 2790 Window wdest; | 2778 Window wdest; |
| 2791 XEvent event; | 2779 XEvent event; |
| 2792 Lisp_Object cons; | 2780 Lisp_Object cons; |
