annotate src/select-msw.c @ 4953:304aebb79cd3

function renamings to track names of char typedefs -------------------- ChangeLog entries follow: -------------------- man/ChangeLog addition: 2010-01-27 Ben Wing <ben@xemacs.org> * internals/internals.texi (lrecords): * internals/internals.texi (The DFC API): * internals/internals.texi (Conversion to and from External Data): * internals/internals.texi (Mule-izing Code): * internals/internals.texi (Pervasive changes throughout XEmacs sources): * internals/internals.texi (Ben's README): * internals/internals.texi (Future Work -- Localized Text/Messages): * emodules.texi (Defining Variables): Rename: write_c_string -> write_cistring build_intstring -> build_istring build_string -> build_cistring build_ext_string -> build_extstring make_ext_string -> make_extstring buffer_insert_c_string -> buffer_insert_ascstring intern_int -> intern_istring See comment in src/ChangeLog about this. modules/ChangeLog addition: 2010-01-27 Ben Wing <ben@xemacs.org> * postgresql/postgresql.c (print_pgconn): * postgresql/postgresql.c (print_pgresult): * postgresql/postgresql.c (Fpq_conn_defaults): * postgresql/postgresql.c (Fpq_pgconn): * postgresql/postgresql.c (Fpq_res_status): * postgresql/postgresql.c (Fpq_result_error_message): * postgresql/postgresql.c (Fpq_fname): * postgresql/postgresql.c (Fpq_get_value): * postgresql/postgresql.c (Fpq_cmd_status): * postgresql/postgresql.c (Fpq_cmd_tuples): * postgresql/postgresql.c (Fpq_notifies): * postgresql/postgresql.c (Fpq_get_line): * postgresql/postgresql.c (Fpq_get_line_async): * postgresql/postgresql.c (FROB): * postgresql/postgresql.c (init_postgresql_from_environment): * ldap/eldap.c: * ldap/eldap.c (Fldap_open): * ldap/eldap.c (Fldap_search_basic): * canna/canna_api.c: * canna/canna_api.c (make_euc_string): Rename: write_c_string -> write_cistring build_intstring -> build_istring build_string -> build_cistring build_ext_string -> build_extstring make_ext_string -> make_extstring buffer_insert_c_string -> buffer_insert_ascstring intern_int -> intern_istring See comment in src/ChangeLog about this. src/ChangeLog addition: 2010-01-27 Ben Wing <ben@xemacs.org> * .gdbinit.in.in: * README: * abbrev.c (write_abbrev): * abbrev.c (describe_abbrev): * alloc.c (make_extstring): * alloc.c (build_istring): * alloc.c (build_cistring): * alloc.c (build_ascstring): * alloc.c (build_extstring): * alloc.c (build_msg_istring): * alloc.c (build_defer_istring): * buffer.c (Fgenerate_new_buffer_name): * buffer.c (init_buffer_2): * console-tty.c (tty_init_console): * console-x.c (get_display_arg_connection): * console-x.c (x_perhaps_init_unseen_key_defaults): * database.c (dbm_map): * database.c (dbm_get): * database.c (berkdb_get): * database.c (berkdb_map): * device-gtk.c (FROB_PIXMAP): * device-gtk.c (Fgtk_style_info): * device-msw.c (msprinter_default_printer): * device-msw.c (sync_printer_with_devmode): * device-x.c (coding_system_of_xrm_database): * device-x.c (x_init_device): * device-x.c (signal_if_x_error): * device-x.c (Fx_get_resource): * device-x.c (Fx_server_vendor): * device-x.c (Fx_get_font_path): * dialog-x.c (maybe_run_dbox_text_callback): * doc.c (extract_object_file_name): * doc.c (unparesseuxify_doc_string): * doc.c (get_doc_string): * doc.c (get_object_file_name): * doc.c (Fdocumentation): * doc.c (Fsnarf_documentation): * doc.c (Fsubstitute_command_keys): * editfns.c (init_editfns): * editfns.c (Ftemp_directory): * editfns.c (Fuser_login_name): * editfns.c (Fuser_real_login_name): * editfns.c (Fuser_home_directory): * editfns.c (Fformat_time_string): * editfns.c (Fcurrent_time_string): * editfns.c (Fcurrent_time_zone): * emacs.c: * emacs.c (main_1): * emodules.c (Flist_modules): * emodules.c (emodules_load): * emodules.c (emodules_doc_sym): * emodules.c (vars_of_module): * event-Xt.c (x_has_keysym): * event-gtk.c (emacs_gtk_format_magic_event): * event-gtk.c (dragndrop_data_received): * event-gtk.c (gtk_reset_key_mapping): * event-msw.c (mswindows_dde_callback): * event-msw.c (mswindows_wnd_proc): * faces.c (complex_vars_of_faces): * file-coding.c (find_coding_system): * file-coding.c (setup_eol_coding_systems): * file-coding.c (make_coding_system_1): * file-coding.c (snarf_coding_system): * fileio.c: * fileio.c (lisp_strerror): * fileio.c (Ffile_name_directory): * fileio.c (Ffile_name_as_directory): * fileio.c (Fdirectory_file_name): * fileio.c (if): * fileio.c (Ffile_symlink_p): * fileio.c (Fencrypt_string): * fileio.c (Fdecrypt_string): * filelock.c (lock_file): * filelock.c (Ffile_locked_p): * floatfns.c (matherr): * font-mgr.c (build_fcapi_string): * font-mgr.c (make_xlfd_font_regexp): * frame-msw.c (mswindows_window_id): * frame-msw.c (mswindows_frame_property): * frame-x.c: * frame-x.c (color_to_string): * frame-x.c (maybe_set_frame_title_format): * frame-x.c (x_cde_transfer_callback): * frame-x.c (Fx_window_id): * glade.c (connector): * glade.c (Fglade_xml_textdomain): * glade.c (syms_of_glade): * glyphs-eimage.c (jpeg_instantiate): * glyphs-eimage.c (png_instantiate): * glyphs-eimage.c (tiff_instantiate): * glyphs-gtk.c (font_instantiate): * glyphs-gtk.c (BUILD_GLYPH_INST): * glyphs-x.c (x_locate_pixmap_file): * glyphs-x.c (font_instantiate): * glyphs-x.c (x_widget_property): * glyphs-x.c (BUILD_GLYPH_INST): * glyphs.c (print_image_instance): * glyphs.c (bitmap_to_lisp_data): * glyphs.c (pixmap_to_lisp_data): * gpmevent.c (turn_off_gpm): * gpmevent.c (Fgpm_enabled_p): * gpmevent.c (Fgpm_enable): * gtk-glue.c (__make_string_mapper): * gtk-glue.c (xemacs_gtklist_to_list): * gtk-xemacs.c (FROB_FACE): * gtk-xemacs.c (xemacs_gtk_convert_color): * hpplay.c (player_error_internal): * hpplay.c (myHandler): * insdel.c (buffer_insert_ascstring_1): * insdel.h: * insdel.h (buffer_insert_ascstring): * intl.c (Fcurrent_locale): * intl.c (Fset_current_locale): * keymap.c (make_key_description): * keymap.c (Ftext_char_description): * keymap.c (describe_command): * keymap.c (describe_map): * lisp.h: * lread.c: * lread.c (locate_file_in_directory_mapper): * lread.c (locate_file_construct_suffixed_files_mapper): * mule-charset.c (Fmake_charset): * nt.c (Fmswindows_short_file_name): * nt.c (Fmswindows_long_file_name): * objects-gtk.c (__get_gtk_font_truename): * objects-gtk.c (__gtk_font_list_internal): * objects-msw.c (font_enum_callback_2): * objects-msw.c (create_hfont_from_font_spec): * objects-msw.c (mswindows_font_list): * objects-msw.c (mswindows_font_spec_matches_charset_stage_2): * objects-tty.c (tty_initialize_font_instance): * objects-x.c (x_font_truename): * objects-x.c (x_font_instance_truename): * objects-x.c (x_font_instance_properties): * objects-x.c (x_font_list): * print.c (write_cistring): * print.c (print_vector_internal): * print.c (print_cons): * process-nt.c (nt_canonicalize_host_name): * process-unix.c (unix_create_process): * process-unix.c (unix_canonicalize_host_name): * process.c (status_message): * process.c (status_notify): * process.c (init_xemacs_process): * process.c (syms_of_process): * redisplay-tty.c (term_get_fkeys_1): * redisplay-tty.c (CONDITIONAL_REASSIGN): * search.c (compile_pattern_1): * select-common.h (selection_data_to_lisp_data): * select-gtk.c (atom_to_symbol): * select-gtk.c (PROCESSING_GTK_CODE): * select-msw.c (mswindows_get_foreign_selection): * select-x.c (x_atom_to_symbol): * select-x.c (Fx_get_cutbuffer_internal): * symbols.c (intern_istring): * symbols.c (intern): * symbols.c (intern_converting_underscores_to_dashes): * symbols.c (Fintern): * sysdep.c (init_system_name): * sysdll.c (dll_error): * sysdll.c (dll_open): * syswindows.h: * syswindows.h (build_tstr_string): * tests.c (DFC_CHECK_LENGTH): * tests.c (DFC_CHECK_CONTENT): * tests.c (DFC_RESULT_PASS): * tests.c (Ftest_data_format_conversion): * text.c: * text.c (new_dfc_convert_now_damn_it): * text.h: * text.h (build_wext_string): * tooltalk.c (tt_build_c_string): * tooltalk.c (Ftooltalk_default_procid): * tooltalk.c (Ftooltalk_default_session): * tooltalk.c (init_tooltalk): * ui-byhand.c (Fgtk_clist_get_text): * ui-byhand.c (Fgtk_clist_get_pixtext): * ui-byhand.c (Fgtk_label_get): * ui-byhand.c (Fgtk_notebook_query_tab_label_packing): * ui-gtk.c (emacs_gtk_object_printer): * ui-gtk.c (emacs_gtk_boxed_printer): * ui-gtk.c (gtk_type_to_lisp): * ui-gtk.c (symbol_to_enum): * ui-gtk.c (enum_to_symbol): * unexaix.c (report_error): * unexaix.c (ERROR0): * unexec.c (report_error): * unexec.c (ERROR0): * unicode.c (unicode_to_ichar): * win32.c (tstr_to_local_file_format): * win32.c (Fmswindows_cygwin_to_win32_path): * win32.c (struct read_link_hash): * xemacs.def.in.in: Rename: write_c_string -> write_cistring build_intstring -> build_istring build_string -> build_cistring build_ext_string -> build_extstring make_ext_string -> make_extstring buffer_insert_c_string -> buffer_insert_ascstring intern_int -> intern_istring These functions have been renamed so that the naming harmonizes with the typedefs for strings: `cistring' along with CIbyte *, `istring' along with Ibyte *, `extstring' along with Extbyte *, `ascstring' along with Ascbyte *. Also make buffer_insert_ascstring take Ascbyte * and assert that its argument is ASCII.
author Ben Wing <ben@xemacs.org>
date Wed, 27 Jan 2010 00:35:36 -0600
parents 04bc9d2f42c7
children 16112448d484 4aebb0131297
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* mswindows selection processing for XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 771
diff changeset
3 Copyright (C) 2000, 2001, 2002 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* Synched up with: Not synched with FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
24 /* This file Mule-ized 7-00?? Needs some Unicode review. --ben */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
25
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 /* Authorship:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 Written by Kevin Gallo for FSF Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 Rewritten for mswindows by Jonathan Harris, December 1997 for 21.0.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
30 Rewritten April 2000 by Ben Wing -- support device methods, Mule-ize.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
31 Hacked by Alastair Houghton, July 2000 for enhanced clipboard support.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
32 */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 #include "lisp.h"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
36 #include "buffer.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 851
diff changeset
37 #include "frame-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 #include "select.h"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
39 #include "opaque.h"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
40 #include "file-coding.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 851
diff changeset
42 #include "console-msw-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
44 static int in_own_selection;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
45
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
46 /* A list of handles that we must release. Not accessible from Lisp. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
47 static Lisp_Object Vhandle_alist;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
48
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
49 void
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
50 mswindows_handle_destroyclipboard (void)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
51 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
52 /* We also receive a destroy message when we call EmptyClipboard() and
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
53 we already own it. In this case we don't want to call
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
54 handle_selection_clear() because it will remove what we're trying
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
55 to add! */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
56 if (!in_own_selection)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
57 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
58 /* We own the clipboard and someone else wants it. Delete our
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
59 cached copy of the clipboard contents so we'll ask for it from
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
60 Windows again when someone does a paste, and destroy any memory
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
61 objects we hold on the clipboard that are not in the list of types
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
62 that Windows will delete itself. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
63 mswindows_destroy_selection (QCLIPBOARD);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
64 handle_selection_clear (QCLIPBOARD);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
65 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
66 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
67
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
68 static int
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
69 mswindows_empty_clipboard (void)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
70 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
71 int retval;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
72
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
73 in_own_selection = 1;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
74 retval = EmptyClipboard ();
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
75 in_own_selection = 0;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
76 return retval;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
77 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
78
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
79 /* Test if this is an X symbol that we understand */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
80 static int
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
81 x_sym_p (Lisp_Object value)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
82 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
83 if (NILP (value) || INTP (value))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
84 return 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
85
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
86 /* Check for some of the X symbols */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
87 if (EQ (value, QSTRING)) return 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
88 if (EQ (value, QTEXT)) return 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
89 if (EQ (value, QCOMPOUND_TEXT)) return 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
90
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
91 return 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
92 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
93
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
94 /* This converts a Lisp symbol to an MS-Windows clipboard format.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
95 We have symbols for all predefined clipboard formats, but that
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
96 doesn't mean we support them all ;-)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
97 The name of this function is actually a lie - it also knows about
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
98 integers and strings... */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
99 static UINT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
100 symbol_to_ms_cf (Lisp_Object value)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
102 /* If it's NIL, we're in trouble. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
103 if (NILP (value)) return 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
104
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
105 /* If it's an integer, assume it's a format ID */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
106 if (INTP (value)) return (UINT) (XINT (value));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
107
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
108 /* If it's a string, register the format(!) */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
109 if (STRINGP (value))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
110 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
111 Extbyte *valext;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
112 LISP_STRING_TO_TSTR (value, valext);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
113 return qxeRegisterClipboardFormat (valext);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
114 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
115
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
116 /* Check for Windows clipboard format symbols */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
117 if (EQ (value, QCF_TEXT)) return CF_TEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
118 if (EQ (value, QCF_BITMAP)) return CF_BITMAP;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
119 if (EQ (value, QCF_METAFILEPICT)) return CF_METAFILEPICT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
120 if (EQ (value, QCF_SYLK)) return CF_SYLK;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
121 if (EQ (value, QCF_DIF)) return CF_DIF;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
122 if (EQ (value, QCF_TIFF)) return CF_TIFF;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
123 if (EQ (value, QCF_OEMTEXT)) return CF_OEMTEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
124 if (EQ (value, QCF_DIB)) return CF_DIB;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
125 #ifdef CF_DIBV5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
126 if (EQ (value, QCF_DIBV5)) return CF_DIBV5;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
127 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
128 if (EQ (value, QCF_PALETTE)) return CF_PALETTE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
129 if (EQ (value, QCF_PENDATA)) return CF_PENDATA;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
130 if (EQ (value, QCF_RIFF)) return CF_RIFF;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
131 if (EQ (value, QCF_WAVE)) return CF_WAVE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
132 if (EQ (value, QCF_UNICODETEXT)) return CF_UNICODETEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
133 if (EQ (value, QCF_ENHMETAFILE)) return CF_ENHMETAFILE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
134 if (EQ (value, QCF_HDROP)) return CF_HDROP;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
135 if (EQ (value, QCF_LOCALE)) return CF_LOCALE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
136 if (EQ (value, QCF_OWNERDISPLAY)) return CF_OWNERDISPLAY;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
137 if (EQ (value, QCF_DSPTEXT)) return CF_DSPTEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
138 if (EQ (value, QCF_DSPBITMAP)) return CF_DSPBITMAP;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
139 if (EQ (value, QCF_DSPMETAFILEPICT)) return CF_DSPMETAFILEPICT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
140 if (EQ (value, QCF_DSPENHMETAFILE)) return CF_DSPENHMETAFILE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
141
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
142 return 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
143 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
144
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
145 /* This converts an MS-Windows clipboard format to its corresponding
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
146 Lisp symbol, or a Lisp integer otherwise. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
147 static Lisp_Object
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
148 ms_cf_to_symbol (UINT format)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
149 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
150 switch (format)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
151 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
152 case CF_TEXT: return QCF_TEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
153 case CF_BITMAP: return QCF_BITMAP;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
154 case CF_METAFILEPICT: return QCF_METAFILEPICT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
155 case CF_SYLK: return QCF_SYLK;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
156 case CF_DIF: return QCF_DIF;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
157 case CF_TIFF: return QCF_TIFF;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
158 case CF_OEMTEXT: return QCF_OEMTEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
159 case CF_DIB: return QCF_DIB;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
160 #ifdef CF_DIBV5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
161 case CF_DIBV5: return QCF_DIBV5;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
162 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
163 case CF_PALETTE: return QCF_PALETTE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
164 case CF_PENDATA: return QCF_PENDATA;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
165 case CF_RIFF: return QCF_RIFF;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
166 case CF_WAVE: return QCF_WAVE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
167 case CF_UNICODETEXT: return QCF_UNICODETEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
168 case CF_ENHMETAFILE: return QCF_ENHMETAFILE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
169 case CF_HDROP: return QCF_HDROP;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
170 case CF_LOCALE: return QCF_LOCALE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
171 case CF_OWNERDISPLAY: return QCF_OWNERDISPLAY;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
172 case CF_DSPTEXT: return QCF_DSPTEXT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
173 case CF_DSPBITMAP: return QCF_DSPBITMAP;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
174 case CF_DSPMETAFILEPICT: return QCF_DSPMETAFILEPICT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
175 case CF_DSPENHMETAFILE: return QCF_DSPENHMETAFILE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
176 default: return make_int ((int) format);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
177 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
178 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
180 /* Test if the specified clipboard format is auto-released by the OS. If
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
181 not, we must remember the handle on Vhandle_alist, and free it if
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
182 the clipboard is emptied or if we set data with the same format. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
183 static int
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
184 cf_is_autofreed (UINT format)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
185 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
186 switch (format)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
187 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
188 /* This list comes from the SDK documentation */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
189 case CF_DSPENHMETAFILE:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
190 case CF_DSPMETAFILEPICT:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
191 case CF_ENHMETAFILE:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
192 case CF_METAFILEPICT:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
193 case CF_BITMAP:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
194 case CF_DSPBITMAP:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
195 case CF_PALETTE:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
196 case CF_DIB:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
197 #ifdef CF_DIBV5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
198 case CF_DIBV5:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
199 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
200 case CF_DSPTEXT:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
201 case CF_OEMTEXT:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
202 case CF_TEXT:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
203 case CF_UNICODETEXT:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
204 return TRUE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
205
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
206 default:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
207 return FALSE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
208 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
209 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
210
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
211 /* Do protocol to assert ourself as a selection owner.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
212
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
213 Under mswindows, we:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
214
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
215 * Only set the clipboard if (eq selection-name 'CLIPBOARD)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
216
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
217 * Check if an X atom name has been passed. If so, convert to CF_TEXT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
218 (or CF_UNICODETEXT) remembering to perform LF -> CR-LF conversion.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
219
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
220 * Otherwise assume the data is formatted appropriately for the data type
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
221 that was passed.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
222
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
223 Then set the clipboard as necessary.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
224 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
225 static Lisp_Object
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
226 mswindows_own_selection (Lisp_Object selection_name,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
227 Lisp_Object selection_value,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
228 Lisp_Object how_to_add,
456
e7ef97881643 Import from CVS: tag r21-2-43
cvs
parents: 442
diff changeset
229 Lisp_Object selection_type,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
230 int UNUSED (owned_p))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
231 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
232 HGLOBAL hValue = NULL;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
233 UINT cfType;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
234 int is_X_type = FALSE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
235 Lisp_Object cfObject;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
236 Lisp_Object data = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
237 int size;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
238 void *src, *dst;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
239 struct frame *f = NULL;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
241 /* Only continue if we're trying to set the clipboard - mswindows doesn't
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
242 use the same selection model as X */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
243 if (!EQ (selection_name, QCLIPBOARD))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
244 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
245
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
246 /* If this is one of the X-style atom name symbols, or NIL, convert it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
247 as appropriate */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
248 if (NILP (selection_type) || x_sym_p (selection_type))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
249 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
250 /* Should COMPOUND_TEXT map to CF_UNICODETEXT? */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
251 if (XEUNICODE_P)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
252 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
253 cfType = CF_UNICODETEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
254 cfObject = QCF_UNICODETEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
255 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
256 else
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
257 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
258 cfType = CF_TEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
259 cfObject = QCF_TEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
260 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
261 is_X_type = TRUE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
262 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
263 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
264 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
265 cfType = symbol_to_ms_cf (selection_type);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
266
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
267 /* Only continue if we can figure out a clipboard type */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
268 if (!cfType)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
269 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
270
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
271 cfObject = selection_type;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
272 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
273
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
274 /* Convert things appropriately */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
275 data = select_convert_out (selection_name,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
276 cfObject,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
277 selection_value);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
279 if (NILP (data))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
280 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
281
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
282 if (CONSP (data))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
283 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
284 if (!EQ (XCAR (data), cfObject))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
285 cfType = symbol_to_ms_cf (XCAR (data));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
286
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
287 if (!cfType)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
288 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
289
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
290 data = XCDR (data);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
291 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
292
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
293 /* We support opaque or string values, but we only mention string
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
294 values for now...
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
295 #### where do the opaque objects come from? currently they're not
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
296 allowed to be exported to the lisp level! */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
297 if (!OPAQUEP (data)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
298 && !STRINGP (data))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
299 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
300
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
301 /* Find the frame */
430
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
302 f = selected_frame ();
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
303
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
304 /* Open the clipboard */
430
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
305 if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
308 /* Obtain the data */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
309 if (OPAQUEP (data))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
310 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
311 src = XOPAQUE_DATA (data);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
312 size = XOPAQUE_SIZE (data);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
313 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
314 else
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
315 /* we do NOT append a zero byte. we don't know whether we're dealing
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
316 with regular text, unicode text, binary data, etc. */
851
e7ee5f8bde58 [xemacs-hg @ 2002-05-23 11:46:08 by ben]
ben
parents: 800
diff changeset
317 TO_EXTERNAL_FORMAT (LISP_STRING, data, MALLOC, (src, size),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
318 Qbinary);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
319
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
320 /* Allocate memory */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
321 hValue = GlobalAlloc (GMEM_DDESHARE | GMEM_MOVEABLE, size);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
322
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
323 if (!hValue)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 CloseClipboard ();
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
326
1726
a8d8f419b459 [xemacs-hg @ 2003-09-30 15:26:34 by james]
james
parents: 872
diff changeset
327 xfree (src, void *);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
328 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
329 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
330
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
331 dst = GlobalLock (hValue);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
332
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
333 if (!dst)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
334 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
335 GlobalFree (hValue);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
336 CloseClipboard ();
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
337
1726
a8d8f419b459 [xemacs-hg @ 2003-09-30 15:26:34 by james]
james
parents: 872
diff changeset
338 xfree (src, void *);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
341
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
342 memcpy (dst, src, size);
1726
a8d8f419b459 [xemacs-hg @ 2003-09-30 15:26:34 by james]
james
parents: 872
diff changeset
343 xfree (src, void *);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
344
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
345 GlobalUnlock (hValue);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
346
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
347 /* Empty the clipboard if we're replacing everything */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
348 if (NILP (how_to_add) || EQ (how_to_add, Qreplace_all))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
350 if (!mswindows_empty_clipboard ())
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
352 CloseClipboard ();
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
353 GlobalFree (hValue);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
354
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
355 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
356 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
358
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
359 /* Append is currently handled in select.el; perhaps this should change,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
360 but it only really makes sense for ordinary text in any case... */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
361
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
362 SetClipboardData (cfType, hValue);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
363
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
364 if (!cf_is_autofreed (cfType))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
365 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
366 Lisp_Object alist_elt = Qnil, rest;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
367 Lisp_Object cfType_int = make_int (cfType);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
368
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
369 /* First check if there's an element in the alist for this type
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
370 already. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
371 alist_elt = assq_no_quit (cfType_int, Vhandle_alist);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
372
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
373 /* Add an element to the alist */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
374 Vhandle_alist = Fcons (Fcons (cfType_int, make_opaque_ptr (hValue)),
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
375 Vhandle_alist);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
376
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
377 if (!NILP (alist_elt))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
378 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
379 /* Free the original handle */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
380 GlobalFree ((HGLOBAL) get_opaque_ptr (XCDR (alist_elt)));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
381
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
382 /* Remove the original one (adding first makes life easier,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
383 because we don't have to special case this being the
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
384 first element) */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
385 for (rest = Vhandle_alist; !NILP (rest); rest = Fcdr (rest))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
386 if (EQ (cfType_int, Fcar (XCDR (rest))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
387 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
388 XCDR (rest) = Fcdr (XCDR (rest));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
389 break;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
390 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
391 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
392 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
393
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 CloseClipboard ();
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
395
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
396 /* #### Should really return a time, though this is because of the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
397 X model (by the looks of things) */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
398 return Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 static Lisp_Object
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
402 mswindows_available_selection_types (Lisp_Object selection_name)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
403 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
404 Lisp_Object types = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
405 UINT format = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
406 struct frame *f = NULL;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
407
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
408 if (!EQ (selection_name, QCLIPBOARD))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
409 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
410
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
411 /* Find the frame */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
412 f = selected_frame ();
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
413
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
414 /* Open the clipboard */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
415 if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
416 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
417
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
418 /* [[ ajh - Should there be an unwind-protect handler around this?
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
419 It could (well it probably won't, but it's always better to
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
420 be safe) run out of memory and leave the clipboard open... ]]
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
421 -- xemacs in general makes no provisions for out-of-memory errors;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
422 we will probably just crash. fixing this is a huge amount of work,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
423 so don't bother protecting in this case. --ben */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
424
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
425 while ((format = EnumClipboardFormats (format)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
426 types = Fcons (ms_cf_to_symbol (format), types);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
427
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
428 /* Close it */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
429 CloseClipboard ();
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
430
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
431 return types;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
432 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
433
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
434 static Lisp_Object
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
435 mswindows_register_selection_data_type (Lisp_Object type_name)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
437 /* Type already checked in select.c */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
438 Extbyte *nameext;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
439 UINT format;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
440
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
441 LISP_STRING_TO_TSTR (type_name, nameext);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
442 format = qxeRegisterClipboardFormat (nameext);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
443
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
444 if (format)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
445 return make_int ((int) format);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
446 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
447 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
448 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
449
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
450 static Lisp_Object
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
451 mswindows_selection_data_type_name (Lisp_Object type_id)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
452 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
453 UINT format;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
454 Extbyte *namebuf;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
455 int numchars;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
456
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
457 /* If it's an integer, convert to a symbol if appropriate */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
458 if (INTP (type_id))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
459 type_id = ms_cf_to_symbol (XINT (type_id));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
460
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
461 /* If this is a symbol, return it */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
462 if (SYMBOLP (type_id))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
463 return type_id;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
464
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
465 /* Find the format code */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
466 format = symbol_to_ms_cf (type_id);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
467
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
468 if (!format)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
469 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
470
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
471 /* Microsoft, stupid Microsoft */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
472 {
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 771
diff changeset
473 int size = 64;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
474 do
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
475 {
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 771
diff changeset
476 size *= 2;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
477 namebuf = alloca_extbytes (size * XETCHAR_SIZE);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
478 numchars = qxeGetClipboardFormatName (format, namebuf, size);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
479 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
480 while (numchars >= size - 1);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
481 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
482
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
483 if (numchars)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
484 return build_tstr_string (namebuf);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
489 static Lisp_Object
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
490 mswindows_get_foreign_selection (Lisp_Object selection_symbol,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
491 Lisp_Object target_type)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
493 HGLOBAL hValue = NULL;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
494 UINT cfType;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
495 Lisp_Object cfObject = Qnil, ret = Qnil, value = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
496 int is_X_type = FALSE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
497 int size;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
498 void *data;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
499 struct frame *f = NULL;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
500 struct gcpro gcpro1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
501
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
502 /* Only continue if we're trying to read the clipboard - mswindows doesn't
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
503 use the same selection model as X */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
504 if (!EQ (selection_symbol, QCLIPBOARD))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
505 return Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
507 /* If this is one of the X-style atom name symbols, or NIL, convert it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
508 as appropriate */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
509 if (NILP (target_type) || x_sym_p (target_type))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
510 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
511 /* Should COMPOUND_TEXT map to CF_UNICODETEXT? */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
512 if (XEUNICODE_P)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
513 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
514 cfType = CF_UNICODETEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
515 cfObject = QCF_UNICODETEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
516 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
517 else
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
518 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
519 cfType = CF_TEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
520 cfObject = QCF_TEXT;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
521 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
522 is_X_type = TRUE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
523 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
524 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
525 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
526 cfType = symbol_to_ms_cf (target_type);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
527
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
528 /* Only continue if we can figure out a clipboard type */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
529 if (!cfType)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
530 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
531
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
532 cfObject = ms_cf_to_symbol (cfType);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
533 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
534
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
535 /* Find the frame */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
536 f = selected_frame ();
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
537
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
538 /* Open the clipboard */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
539 if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
542 /* Read the clipboard */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
543 hValue = GetClipboardData (cfType);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
544
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
545 if (!hValue)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
547 CloseClipboard ();
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
549 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
550 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
552 /* Find the data */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
553 size = GlobalSize (hValue);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
554 data = GlobalLock (hValue);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
556 if (!data)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
557 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
558 CloseClipboard ();
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
559
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
560 return Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
563 /* Place it in a Lisp string */
4953
304aebb79cd3 function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents: 2286
diff changeset
564 ret = make_extstring ((Extbyte *) data, size, Qbinary);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
565
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
566 GlobalUnlock (data);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 CloseClipboard ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
569 GCPRO1 (ret);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
571 /* Convert this to the appropriate type. If we can't find anything,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
572 then we return a cons of the form (DATA-TYPE . STRING), where the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
573 string contains the raw binary data. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
574 value = select_convert_in (selection_symbol,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
575 cfObject,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
576 ret);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
578 UNGCPRO;
430
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
579
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
580 if (NILP (value))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
581 return Fcons (cfObject, ret);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
582 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
583 return value;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
587 mswindows_disown_selection (Lisp_Object selection,
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
588 Lisp_Object UNUSED (timeval))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 if (EQ (selection, QCLIPBOARD))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
591 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
592 BOOL success = OpenClipboard (NULL);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
593 if (success)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
594 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
595 /* the caller calls handle_selection_clear(). */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
596 success = mswindows_empty_clipboard ();
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
597 /* Close it regardless of whether empty worked. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
598 if (!CloseClipboard ())
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
599 success = FALSE;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
600 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
601
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
602 /* #### return success ? Qt : Qnil; */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
603 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
604 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
605
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
606 void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
607 mswindows_destroy_selection (Lisp_Object selection)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
608 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
609 /* Do nothing if this isn't for the clipboard. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
610 if (!EQ (selection, QCLIPBOARD))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
611 return;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
612
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
613 /* Right. We need to delete everything in Vhandle_alist. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
614 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
615 LIST_LOOP_2 (elt, Vhandle_alist)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
616 GlobalFree ((HGLOBAL) get_opaque_ptr (XCDR (elt)));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
617 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
618
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
619 Vhandle_alist = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
620 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
621
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
622 static Lisp_Object
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
623 mswindows_selection_exists_p (Lisp_Object selection,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
624 Lisp_Object selection_type)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
625 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
626 /* We used to be picky about the format, but now we support anything. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
627 if (EQ (selection, QCLIPBOARD))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
628 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
629 if (NILP (selection_type))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
630 return CountClipboardFormats () ? Qt : Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
631 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
632 return IsClipboardFormatAvailable (symbol_to_ms_cf (selection_type))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
633 ? Qt : Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
634 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
635 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
636 return Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 /* initialization */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 console_type_create_select_mswindows (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 CONSOLE_HAS_METHOD (mswindows, own_selection);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 CONSOLE_HAS_METHOD (mswindows, disown_selection);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
649 CONSOLE_HAS_METHOD (mswindows, selection_exists_p);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 CONSOLE_HAS_METHOD (mswindows, get_foreign_selection);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
651 CONSOLE_HAS_METHOD (mswindows, available_selection_types);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
652 CONSOLE_HAS_METHOD (mswindows, register_selection_data_type);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
653 CONSOLE_HAS_METHOD (mswindows, selection_data_type_name);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 syms_of_select_mswindows (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 vars_of_select_mswindows (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
664 /* Initialise Vhandle_alist */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
665 Vhandle_alist = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
666 staticpro (&Vhandle_alist);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 }
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
668
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
669 void
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
670 init_select_mswindows (void)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
671 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
672 /* Reinitialise Vhandle_alist */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
673 /* #### Why do we need to do this? Somehow I added this. --ben */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
674 Vhandle_alist = Qnil;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 593
diff changeset
675 }