/[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.106 by raeburn, Tue Oct 16 09:09:51 2001 UTC revision 1.107 by pj, Sun Oct 21 12:13:46 2001 UTC
# Line 1948  x_handle_selection_notify (event) Line 1948  x_handle_selection_notify (event)
1948    
1949    
1950  DEFUN ("x-own-selection-internal", Fx_own_selection_internal,  DEFUN ("x-own-selection-internal", Fx_own_selection_internal,
1951    Sx_own_selection_internal, 2, 2, 0,         Sx_own_selection_internal, 2, 2, 0,
1952    "Assert an X selection of the given TYPE with the given VALUE.\n\         doc: /* Assert an X selection of the given TYPE with the given VALUE.
1953  TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.\n\  TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
1954  \(Those are literal upper-case symbol names, since that's what X expects.)\n\  \(Those are literal upper-case symbol names, since that's what X expects.)
1955  VALUE is typically a string, or a cons of two markers, but may be\n\  VALUE is typically a string, or a cons of two markers, but may be
1956  anything that the functions on `selection-converter-alist' know about.")  anything that the functions on `selection-converter-alist' know about.  */)
1957    (selection_name, selection_value)       (selection_name, selection_value)
1958       Lisp_Object selection_name, selection_value;       Lisp_Object selection_name, selection_value;
1959  {  {
1960    check_x ();    check_x ();
# Line 1970  anything that the functions on `selectio Line 1970  anything that the functions on `selectio
1970     will block until all of the data has arrived.  */     will block until all of the data has arrived.  */
1971    
1972  DEFUN ("x-get-selection-internal", Fx_get_selection_internal,  DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
1973    Sx_get_selection_internal, 2, 2, 0,         Sx_get_selection_internal, 2, 2, 0,
1974    "Return text selected from some X window.\n\         doc: /* Return text selected from some X window.
1975  SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.\n\  SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
1976  \(Those are literal upper-case symbol names, since that's what X expects.)\n\  \(Those are literal upper-case symbol names, since that's what X expects.)
1977  TYPE is the type of data desired, typically `STRING'.")  TYPE is the type of data desired, typically `STRING'.  */)
1978    (selection_symbol, target_type)       (selection_symbol, target_type)
1979       Lisp_Object selection_symbol, target_type;       Lisp_Object selection_symbol, target_type;
1980  {  {
1981    Lisp_Object val = Qnil;    Lisp_Object val = Qnil;
# Line 2018  TYPE is the type of data desired, typica Line 2018  TYPE is the type of data desired, typica
2018  }  }
2019    
2020  DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,  DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
2021    Sx_disown_selection_internal, 1, 2, 0,         Sx_disown_selection_internal, 1, 2, 0,
2022    "If we own the selection SELECTION, disown it.\n\         doc: /* If we own the selection SELECTION, disown it.
2023  Disowning it means there is no such selection.")  Disowning it means there is no such selection.  */)
2024    (selection, time)       (selection, time)
2025       Lisp_Object selection;       Lisp_Object selection;
2026       Lisp_Object time;       Lisp_Object time;
2027  {  {
# Line 2085  x_disown_buffer_selections (buffer) Line 2085  x_disown_buffer_selections (buffer)
2085  }  }
2086    
2087  DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,  DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
2088    0, 1, 0,         0, 1, 0,
2089    "Whether the current Emacs process owns the given X Selection.\n\         doc: /* Whether the current Emacs process owns the given X Selection.
2090  The arg should be the name of the selection in question, typically one of\n\  The arg should be the name of the selection in question, typically one of
2091  the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.\n\  the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
2092  \(Those are literal upper-case symbol names, since that's what X expects.)\n\  \(Those are literal upper-case symbol names, since that's what X expects.)
2093  For convenience, the symbol nil is the same as `PRIMARY',\n\  For convenience, the symbol nil is the same as `PRIMARY',
2094  and t is the same as `SECONDARY'.)")  and t is the same as `SECONDARY'.  */)
2095    (selection)       (selection)
2096       Lisp_Object selection;       Lisp_Object selection;
2097  {  {
2098    check_x ();    check_x ();
# Line 2106  and t is the same as `SECONDARY'.)") Line 2106  and t is the same as `SECONDARY'.)")
2106  }  }
2107    
2108  DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,  DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
2109    0, 1, 0,         0, 1, 0,
2110    "Whether there is an owner for the given X Selection.\n\         doc: /* Whether there is an owner for the given X Selection.
2111  The arg should be the name of the selection in question, typically one of\n\  The arg should be the name of the selection in question, typically one of
2112  the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.\n\  the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
2113  \(Those are literal upper-case symbol names, since that's what X expects.)\n\  \(Those are literal upper-case symbol names, since that's what X expects.)
2114  For convenience, the symbol nil is the same as `PRIMARY',\n\  For convenience, the symbol nil is the same as `PRIMARY',
2115  and t is the same as `SECONDARY'.)")  and t is the same as `SECONDARY'.  */)
2116    (selection)       (selection)
2117       Lisp_Object selection;       Lisp_Object selection;
2118  {  {
2119    Window owner;    Window owner;
# Line 2178  initialize_cut_buffers (display, window) Line 2178  initialize_cut_buffers (display, window)
2178    }    }
2179    
2180  DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,  DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
2181    Sx_get_cut_buffer_internal, 1, 1, 0,         Sx_get_cut_buffer_internal, 1, 1, 0,
2182    "Returns the value of the named cut buffer (typically CUT_BUFFER0).")         doc: /* Returns the value of the named cut buffer (typically CUT_BUFFER0).  */)
2183    (buffer)       (buffer)
2184       Lisp_Object buffer;       Lisp_Object buffer;
2185  {  {
2186    Window window;    Window window;
# Line 2222  DEFUN ("x-get-cut-buffer-internal", Fx_g Line 2222  DEFUN ("x-get-cut-buffer-internal", Fx_g
2222    
2223    
2224  DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal,  DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal,
2225    Sx_store_cut_buffer_internal, 2, 2, 0,         Sx_store_cut_buffer_internal, 2, 2, 0,
2226    "Sets the value of the named cut buffer (typically CUT_BUFFER0).")         doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0).  */)
2227    (buffer, string)       (buffer, string)
2228       Lisp_Object buffer, string;       Lisp_Object buffer, string;
2229  {  {
2230    Window window;    Window window;
# Line 2283  DEFUN ("x-store-cut-buffer-internal", Fx Line 2283  DEFUN ("x-store-cut-buffer-internal", Fx
2283    
2284    
2285  DEFUN ("x-rotate-cut-buffers-internal", Fx_rotate_cut_buffers_internal,  DEFUN ("x-rotate-cut-buffers-internal", Fx_rotate_cut_buffers_internal,
2286    Sx_rotate_cut_buffers_internal, 1, 1, 0,         Sx_rotate_cut_buffers_internal, 1, 1, 0,
2287    "Rotate the values of the cut buffers by the given number of step.\n\         doc: /* Rotate the values of the cut buffers by the given number of step.
2288  Positive means shift the values forward, negative means backward.")  Positive means shift the values forward, negative means backward.  */)
2289    (n)       (n)
2290       Lisp_Object n;       Lisp_Object n;
2291  {  {
2292    Window window;    Window window;
# Line 2351  syms_of_xselect () Line 2351  syms_of_xselect ()
2351    staticpro (&Vselection_alist);    staticpro (&Vselection_alist);
2352    
2353    DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_alist,    DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_alist,
2354      "An alist associating X Windows selection-types with functions.\n\                 doc: /* An alist associating X Windows selection-types with functions.
2355  These functions are called to convert the selection, with three args:\n\  These functions are called to convert the selection, with three args:
2356  the name of the selection (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');\n\  the name of the selection (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');
2357  a desired type to which the selection should be converted;\n\  a desired type to which the selection should be converted;
2358  and the local selection value (whatever was given to `x-own-selection').\n\  and the local selection value (whatever was given to `x-own-selection').
2359  \n\  
2360  The function should return the value to send to the X server\n\  The function should return the value to send to the X server
2361  \(typically a string).  A return value of nil\n\  \(typically a string).  A return value of nil
2362  means that the conversion could not be done.\n\  means that the conversion could not be done.
2363  A return value which is the symbol `NULL'\n\  A return value which is the symbol `NULL'
2364  means that a side-effect was executed,\n\  means that a side-effect was executed,
2365  and there is no meaningful selection value.");  and there is no meaningful selection value.  */);
2366    Vselection_converter_alist = Qnil;    Vselection_converter_alist = Qnil;
2367    
2368    DEFVAR_LISP ("x-lost-selection-hooks", &Vx_lost_selection_hooks,    DEFVAR_LISP ("x-lost-selection-hooks", &Vx_lost_selection_hooks,
2369      "A list of functions to be called when Emacs loses an X selection.\n\                 doc: /* A list of functions to be called when Emacs loses an X selection.
2370  \(This happens when some other X client makes its own selection\n\  \(This happens when some other X client makes its own selection
2371  or when a Lisp program explicitly clears the selection.)\n\  or when a Lisp program explicitly clears the selection.)
2372  The functions are called with one argument, the selection type\n\  The functions are called with one argument, the selection type
2373  \(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD').");  \(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD').  */);
2374    Vx_lost_selection_hooks = Qnil;    Vx_lost_selection_hooks = Qnil;
2375    
2376    DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks,    DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks,
2377      "A list of functions to be called when Emacs answers a selection request.\n\                 doc: /* A list of functions to be called when Emacs answers a selection request.
2378  The functions are called with four arguments:\n\  The functions are called with four arguments:
2379    - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');\n\    - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');
2380    - the selection-type which Emacs was asked to convert the\n\    - the selection-type which Emacs was asked to convert the
2381      selection into before sending (for example, `STRING' or `LENGTH');\n\      selection into before sending (for example, `STRING' or `LENGTH');
2382    - a flag indicating success or failure for responding to the request.\n\    - a flag indicating success or failure for responding to the request.
2383  We might have failed (and declined the request) for any number of reasons,\n\  We might have failed (and declined the request) for any number of reasons,
2384  including being asked for a selection that we no longer own, or being asked\n\  including being asked for a selection that we no longer own, or being asked
2385  to convert into a type that we don't know about or that is inappropriate.\n\  to convert into a type that we don't know about or that is inappropriate.
2386  This hook doesn't let you change the behavior of Emacs's selection replies,\n\  This hook doesn't let you change the behavior of Emacs's selection replies,
2387  it merely informs you that they have happened.");  it merely informs you that they have happened.  */);
2388    Vx_sent_selection_hooks = Qnil;    Vx_sent_selection_hooks = Qnil;
2389    
2390    DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,    DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
2391      "Coding system for communicating with other X clients.\n\                 doc: /* Coding system for communicating with other X clients.
2392  When sending or receiving text via cut_buffer, selection, and clipboard,\n\  When sending or receiving text via cut_buffer, selection, and clipboard,
2393  the text is encoded or decoded by this coding system.\n\  the text is encoded or decoded by this coding system.
2394  The default value is `compound-text'.");  The default value is `compound-text'.  */);
2395    Vselection_coding_system = intern ("compound-text");    Vselection_coding_system = intern ("compound-text");
2396    
2397    DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,    DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,
2398      "Coding system for the next communication with other X clients.\n\                 doc: /* Coding system for the next communication with other X clients.
2399  Usually, `selection-coding-system' is used for communicating with\n\  Usually, `selection-coding-system' is used for communicating with
2400  other X clients.   But, if this variable is set, it is used for the\n\  other X clients.   But, if this variable is set, it is used for the
2401  next communication only.   After the communication, this variable is\n\  next communication only.   After the communication, this variable is
2402  set to nil.");  set to nil.  */);
2403    Vnext_selection_coding_system = Qnil;    Vnext_selection_coding_system = Qnil;
2404    
2405    DEFVAR_INT ("x-selection-timeout", &x_selection_timeout,    DEFVAR_INT ("x-selection-timeout", &x_selection_timeout,
2406      "Number of milliseconds to wait for a selection reply.\n\                doc: /* Number of milliseconds to wait for a selection reply.
2407  If the selection owner doesn't reply in this time, we give up.\n\  If the selection owner doesn't reply in this time, we give up.
2408  A value of 0 means wait as long as necessary.  This is initialized from the\n\  A value of 0 means wait as long as necessary.  This is initialized from the
2409  \"*selectionTimeout\" resource.");  \"*selectionTimeout\" resource.  */);
2410    x_selection_timeout = 0;    x_selection_timeout = 0;
2411    
2412    QPRIMARY   = intern ("PRIMARY");      staticpro (&QPRIMARY);    QPRIMARY   = intern ("PRIMARY");      staticpro (&QPRIMARY);

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

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