Mercurial > hg > xemacs-beta
annotate src/dragdrop.c @ 4874:4c3f5e1ecbeb
ChangeLog for previous patch: regenerate intl-auto-encap-win32.c
(fix build problems when building --with-msw=no on Cygwin)
-------------------- ChangeLog entries follow: --------------------
lib-src/ChangeLog addition:
2010-01-15 Ben Wing <ben@xemacs.org>
* make-mswin-unicode.pl:
Various fixes to get this to work when using the Cygwin header files
in /usr/include/w32api instead of the VC++ ones:
-- Use /usr/include/w32api as default; don't assume that a passed-in
directory always ends in .../include.
-- Add `const' to list of known type modifiers.
-- If function already seen, warn but don't generate twice.
-- Eliminate `extern' from return type modifiers.
-- Cosmetic: When eliminating APIENTRY, also eliminate following
whitespace.
src/ChangeLog addition:
2010-01-15 Ben Wing <ben@xemacs.org>
* intl-auto-encap-win32.c:
* intl-auto-encap-win32.c (qxeExtractAssociatedIcon):
* intl-auto-encap-win32.c (qxeShellExecuteEx):
* intl-auto-encap-win32.c (qxeSHFileOperation):
* intl-auto-encap-win32.c (qxeSHQueryRecycleBin):
* intl-auto-encap-win32.c (qxeSHEmptyRecycleBin):
* intl-auto-encap-win32.c (qxeWNetAddConnection):
* intl-auto-encap-win32.c (qxeWNetAddConnection2):
* intl-auto-encap-win32.c (qxeWNetAddConnection3):
* intl-auto-encap-win32.c (qxeWNetCancelConnection):
* intl-auto-encap-win32.c (qxeWNetCancelConnection2):
* intl-auto-encap-win32.c (qxeWNetGetConnection):
* intl-auto-encap-win32.c (qxeWNetUseConnection):
* intl-auto-encap-win32.c (qxeWNetConnectionDialog1):
* intl-auto-encap-win32.c (qxeWNetDisconnectDialog1):
* intl-auto-encap-win32.c (qxeWNetOpenEnum):
* intl-auto-encap-win32.c (qxeWNetEnumResource):
* intl-auto-encap-win32.c (qxeWNetGetUniversalName):
* intl-auto-encap-win32.c (qxeWNetGetUser):
* intl-auto-encap-win32.c (qxeWNetGetProviderName):
* intl-auto-encap-win32.c (qxeWNetGetNetworkInformation):
* intl-auto-encap-win32.c (qxeWNetGetLastError):
* intl-auto-encap-win32.c (qxeMultinetGetConnectionPerformance):
* intl-auto-encap-win32.c (qxeAppendMenu):
* intl-auto-encap-win32.c (qxeCopyAcceleratorTable):
* intl-auto-encap-win32.c (qxeDlgDirSelectComboBoxEx):
* intl-auto-encap-win32.c (qxeEnumDesktops):
* intl-auto-encap-win32.c (qxeEnumWindowStations):
* intl-auto-encap-win32.c (qxeGetClassInfo):
* intl-auto-encap-win32.c (qxeGetClassLong):
* intl-auto-encap-win32.c (qxeGetClassName):
* intl-auto-encap-win32.c (qxeGetKeyboardLayoutName):
* intl-auto-encap-win32.c (qxeGetWindowLong):
* intl-auto-encap-win32.c (qxeGetUserObjectInformation):
* intl-auto-encap-win32.c (qxeGetWindowTextLength):
* intl-auto-encap-win32.c (qxeGrayString):
* intl-auto-encap-win32.c (qxeInsertMenu):
* intl-auto-encap-win32.c (qxeSetProp):
* intl-auto-encap-win32.c (qxeEnumICMProfiles):
* intl-auto-encap-win32.c (qxeExtTextOut):
* intl-auto-encap-win32.c (qxeSetICMProfile):
* intl-auto-encap-win32.c (qxeTextOut):
* intl-auto-encap-win32.c (qxeSHGetPathFromIDList):
* intl-auto-encap-win32.c (qxeFindText):
* intl-auto-encap-win32.c (qxeReplaceText):
* intl-auto-encap-win32.c (qxeImmInstallIME):
* intl-auto-encap-win32.c (qxeImmGetDescription):
* intl-auto-encap-win32.c (qxeImmGetIMEFileName):
* intl-auto-encap-win32.c (qxeImmGetCompositionString):
* intl-auto-encap-win32.c (qxeImmGetCandidateListCount):
* intl-auto-encap-win32.c (qxeImmGetCandidateList):
* intl-auto-encap-win32.c (qxeImmGetGuideLine):
* intl-auto-encap-win32.c (qxeImmConfigureIME):
* intl-auto-encap-win32.c (qxeImmEscape):
* intl-auto-encap-win32.c (qxeImmGetConversionList):
* intl-auto-encap-win32.c (qxeImmRegisterWord):
* intl-auto-encap-win32.c (qxeImmUnregisterWord):
* intl-auto-encap-win32.c (qxeImmEnumRegisterWord):
* intl-auto-encap-win32.c (qxesndPlaySound):
* intl-auto-encap-win32.c (qxePlaySound):
* intl-auto-encap-win32.c (qxewaveOutGetErrorText):
* intl-auto-encap-win32.c (qxewaveInGetErrorText):
* intl-auto-encap-win32.c (qxemidiOutGetErrorText):
* intl-auto-encap-win32.c (qxemidiInGetErrorText):
* intl-auto-encap-win32.c (qxemmioStringToFOURCC):
* intl-auto-encap-win32.c (qxemmioInstallIOProc):
* intl-auto-encap-win32.c (qxemmioOpen):
* intl-auto-encap-win32.c (qxemmioRename):
* intl-auto-encap-win32.c (qxemciSendCommand):
* intl-auto-encap-win32.c (qxemciSendString):
* intl-auto-encap-win32.c (qxemciGetDeviceID):
* intl-auto-encap-win32.c (qxemciGetErrorString):
* intl-auto-encap-win32.h:
* intl-auto-encap-win32.h (qxemciGetErrorString):
Regenerate these files from Cygwin headers.
* intl-encap-win32.c:
Bracket more functions in HAVE_MS_WINDOWS, to fix build problems
when building --with-msw=no on Cygwin.
Fixes for Cygwin headers:
-- Comment out IME.H, non-existent in Cygwin.
-- Make MessageBoxIndirect a `no' (don't encapsulate but generate
error if used) because it has a structure parameter that needs
to be A/W split but is declared as FOO*, and our parser can't
split this.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Fri, 15 Jan 2010 05:12:07 -0600 |
parents | bc4f2511bbea |
children | 308d34e9f07d |
rev | line source |
---|---|
428 | 1 /* Drag'n'Drop definitions |
2 created 03-may-98 by Oliver Graf <ograf@fga.de> | |
3 Copyright (C) 1998 Oliver Graf <ograf@fga.de> | |
2367 | 4 Copyright (C) 2004 Ben Wing. |
428 | 5 |
6 This file is part of XEmacs. | |
7 | |
8 XEmacs is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
10 Free Software Foundation; either version 2, or (at your option) any | |
11 later version. | |
12 | |
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with XEmacs; see the file COPYING. If not, write to | |
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
21 Boston, MA 02111-1307, USA. */ | |
22 | |
23 /* Synched up with: Not in FSF. */ | |
24 | |
25 /* This file should be Mule-ized. */ | |
26 | |
27 /* A short introduction to the new Drag'n'Drop Model: | |
28 | |
29 A drop generates a extended misc-user-event, as defined in events.[ch]. | |
30 This event contains the same as a eval and a button event. | |
31 The function of a drop is set to 'dragdrop-drop-dispatch' which will be | |
32 defined in ../lisp/dragdrop.el. | |
33 The object of the misc-user-event has the following format: | |
34 ( TYPE . DATA ) | |
3025 | 35 TYPE is one of `dragdrop-MIME' and `dragdrop-URL' |
36 DATA - if TYPE is `dragdrop-URL', DATA is a list of valid URL strings. It | |
428 | 37 is always a list, also if only one URL string is within it. |
3025 | 38 - if TYPE is `dragdrop-MIME', DATA is a list of MIME elements. |
428 | 39 Each can be a string or a list. |
40 if it is a string it is the pure MIME data complete with header | |
41 and body. | |
42 if it is a list it should look like | |
43 ( MIME-TYPE MIME-ENCODING MIME-DATA ) | |
44 MIME-TYPE list of type and key.value conses. Same as in tm-view | |
45 MIME-ENC the same (a string in this case) | |
46 MIME-DATA is a string | |
47 */ | |
48 | |
49 #include <config.h> | |
50 #include "lisp.h" | |
51 #include "dragdrop.h" | |
52 | |
53 /* The supported protocol list */ | |
54 Lisp_Object Vdragdrop_protocols; | |
55 | |
56 /* Drag'n'Drop data types known by XEmacs */ | |
57 Lisp_Object Qdragdrop_MIME; | |
58 Lisp_Object Qdragdrop_URL; | |
59 | |
60 /* External defined functions to handle Drag'n'Drop */ | |
61 Lisp_Object Qdragdrop_drop_dispatch; | |
62 | |
63 /* from wget -- thanxx Hrvoje */ | |
64 /* A list of unsafe characters for encoding, as per RFC1738. '@' and | |
65 ':' (not listed in RFC) were added because of user/password | |
66 encoding, and \033 for safe printing. */ | |
67 | |
68 #define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033" | |
69 | |
70 /* HEX digit -> ASCII char */ | |
71 #define HEXD2ASC(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A')) | |
72 | |
73 /* Encodes the unsafe characters (listed in URL_UNSAFE) in a given | |
74 string, returning a malloc-ed %XX encoded string. | |
75 if method is != NULL it is prepended to the string. */ | |
2367 | 76 Ibyte * |
77 dnd_url_hexify_string (const Ibyte *s, const Ibyte *m) | |
428 | 78 { |
2367 | 79 const Ibyte *b; |
80 Ibyte *p, *res; | |
81 Bytecount i; | |
428 | 82 |
83 b = s; | |
84 for (i = 0; *s; s++, i++) | |
85 if (strchr (URL_UNSAFE, *s)) | |
86 i += 2; /* Two more characters (hex digits) */ | |
87 if (m) | |
88 { | |
2367 | 89 res = xnew_ibytes (i + ITEXT_ZTERM_SIZE + qxestrlen (m)); |
90 qxestrcpy (res, m); | |
91 p = res + qxestrlen (m); | |
428 | 92 } |
93 else | |
94 { | |
2367 | 95 res = xnew_ibytes (i + ITEXT_ZTERM_SIZE); |
428 | 96 p = res; |
97 } | |
98 for (s = b; *s; s++) | |
99 if (strchr (URL_UNSAFE, *s)) | |
100 { | |
2367 | 101 const Ibyte c = *s; |
428 | 102 *p++ = '%'; |
103 *p++ = HEXD2ASC (c >> 4); | |
104 *p++ = HEXD2ASC (c & 0xf); | |
105 } | |
106 else | |
107 *p++ = *s; | |
108 *p = '\0'; | |
109 return res; | |
110 } | |
111 | |
112 void | |
113 syms_of_dragdrop (void) | |
114 { | |
563 | 115 DEFSYMBOL (Qdragdrop_MIME); |
116 DEFSYMBOL (Qdragdrop_URL); | |
117 DEFSYMBOL (Qdragdrop_drop_dispatch); | |
428 | 118 } |
119 | |
120 void | |
121 vars_of_dragdrop (void) | |
122 { | |
123 Fprovide (intern ("dragdrop-api")); | |
124 | |
125 DEFVAR_CONST_LISP ("dragdrop-protocols", &Vdragdrop_protocols /* | |
126 A list of supported Drag'n'drop protocols. | |
127 Each element is the feature symbol of the protocol. | |
128 */ ); | |
129 | |
130 Vdragdrop_protocols = Qnil; | |
131 | |
132 #ifdef HAVE_MS_WINDOWS | |
2367 | 133 Vdragdrop_protocols = Fcons (Qmswindows, Vdragdrop_protocols); |
428 | 134 #endif |
135 #ifdef HAVE_CDE | |
2367 | 136 Vdragdrop_protocols = Fcons (intern ("cde"), Vdragdrop_protocols); |
428 | 137 #endif |
462 | 138 #ifdef HAVE_GTK |
2367 | 139 Vdragdrop_protocols = Fcons (Qgtk, Vdragdrop_protocols); |
462 | 140 #endif |
428 | 141 } |