Mercurial > hg > xemacs-beta
comparison src/event-msw.c @ 284:558f606b08ae r21-0b40
Import from CVS: tag r21-0b40
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:34:13 +0200 |
parents | c42ec1d1cded |
children | 57709be46d1b |
comparison
equal
deleted
inserted
replaced
283:fa3d41851a08 | 284:558f606b08ae |
---|---|
41 | 41 |
42 #ifdef HAVE_MENUBARS | 42 #ifdef HAVE_MENUBARS |
43 # include "menubar-msw.h" | 43 # include "menubar-msw.h" |
44 #endif | 44 #endif |
45 | 45 |
46 #ifdef HAVE_DRAGNDROP | |
47 # include "dragdrop.h" | |
48 #endif | |
49 | |
46 #include "device.h" | 50 #include "device.h" |
47 #include "dragdrop.h" | |
48 #include "events.h" | 51 #include "events.h" |
49 #include "frame.h" | 52 #include "frame.h" |
50 #include "lstream.h" | 53 #include "lstream.h" |
51 #include "process.h" | 54 #include "process.h" |
52 #include "redisplay.h" | 55 #include "redisplay.h" |
56 #include "sysdep.h" | 59 #include "sysdep.h" |
57 | 60 |
58 #include "events-mod.h" | 61 #include "events-mod.h" |
59 #ifdef HAVE_MSG_SELECT | 62 #ifdef HAVE_MSG_SELECT |
60 #include "sysfile.h" | 63 #include "sysfile.h" |
64 #elif defined(__CYGWIN32__) | |
65 typedef unsigned int SOCKET; | |
61 #endif | 66 #endif |
62 #include <io.h> | 67 #include <io.h> |
63 #include <errno.h> | 68 #include <errno.h> |
64 | 69 |
65 #ifdef HAVE_MENUBARS | 70 #ifdef HAVE_MENUBARS |
1408 mswindows_enqueue_dispatch_event (emacs_event); | 1413 mswindows_enqueue_dispatch_event (emacs_event); |
1409 } | 1414 } |
1410 | 1415 |
1411 /* | 1416 /* |
1412 * Callback procedure for dde messages | 1417 * Callback procedure for dde messages |
1418 * | |
1419 * We execute a dde Open("file") by simulating a file drop, so dde support | |
1420 * depends on dnd support. | |
1413 */ | 1421 */ |
1422 #ifdef HAVE_DRAGNDROP | |
1414 HDDEDATA CALLBACK | 1423 HDDEDATA CALLBACK |
1415 mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, | 1424 mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, |
1416 HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, | 1425 HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, |
1417 DWORD dwData1, DWORD dwData2) | 1426 DWORD dwData1, DWORD dwData2) |
1418 { | 1427 { |
1444 char *end; | 1453 char *end; |
1445 char *filename; | 1454 char *filename; |
1446 struct gcpro gcpro1, gcpro2; | 1455 struct gcpro gcpro1, gcpro2; |
1447 Lisp_Object l_dndlist = Qnil; | 1456 Lisp_Object l_dndlist = Qnil; |
1448 Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); | 1457 Lisp_Object emacs_event = Fmake_event (Qnil, Qnil); |
1458 Lisp_Object frmcons, devcons, concons; | |
1449 struct Lisp_Event *event = XEVENT (emacs_event); | 1459 struct Lisp_Event *event = XEVENT (emacs_event); |
1450 | 1460 |
1451 DdeGetData (hdata, cmd, len, 0); | 1461 DdeGetData (hdata, cmd, len, 0); |
1452 cmd[len] = '\0'; | 1462 cmd[len] = '\0'; |
1453 DdeFreeDataHandle (hdata); | 1463 DdeFreeDataHandle (hdata); |
1489 strcat (filename, cmd); | 1499 strcat (filename, cmd); |
1490 #endif | 1500 #endif |
1491 GCPRO2 (emacs_event, l_dndlist); | 1501 GCPRO2 (emacs_event, l_dndlist); |
1492 l_dndlist = make_string (filename, strlen (filename)); | 1502 l_dndlist = make_string (filename, strlen (filename)); |
1493 | 1503 |
1504 /* Find a mswindows frame */ | |
1494 event->channel = Qnil; | 1505 event->channel = Qnil; |
1506 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) | |
1507 { | |
1508 Lisp_Object frame = XCAR (frmcons); | |
1509 if (FRAME_TYPE_P (XFRAME (frame), mswindows)) | |
1510 event->channel = frame; | |
1511 }; | |
1512 assert (!NILP (event->channel)); | |
1513 | |
1495 event->timestamp = GetTickCount(); | 1514 event->timestamp = GetTickCount(); |
1496 event->event_type = misc_user_event; | 1515 event->event_type = misc_user_event; |
1497 event->event.misc.button = 1; | 1516 event->event.misc.button = 1; |
1498 event->event.misc.modifiers = 0; | 1517 event->event.misc.modifiers = 0; |
1499 event->event.misc.x = -1; | 1518 event->event.misc.x = -1; |
1509 return (HDDEDATA) DDE_FNOTPROCESSED; | 1528 return (HDDEDATA) DDE_FNOTPROCESSED; |
1510 | 1529 |
1511 default: | 1530 default: |
1512 return (HDDEDATA) NULL; | 1531 return (HDDEDATA) NULL; |
1513 } | 1532 } |
1514 | 1533 } |
1515 } | 1534 #endif |
1516 | 1535 |
1517 /* | 1536 /* |
1518 * The windows procedure for the window class XEMACS_CLASS | 1537 * The windows procedure for the window class XEMACS_CLASS |
1519 */ | 1538 */ |
1520 LRESULT WINAPI | 1539 LRESULT WINAPI |
2057 /* Bite me - a spurious command. This cannot happen. */ | 2076 /* Bite me - a spurious command. This cannot happen. */ |
2058 error ("XEMACS BUG: Cannot decode command message"); | 2077 error ("XEMACS BUG: Cannot decode command message"); |
2059 } | 2078 } |
2060 break; | 2079 break; |
2061 | 2080 |
2081 #ifdef HAVE_DRAGNDROP | |
2062 case WM_DROPFILES: /* implementation ripped-off from event-Xt.c */ | 2082 case WM_DROPFILES: /* implementation ripped-off from event-Xt.c */ |
2063 { | 2083 { |
2064 UINT filecount, i, len; | 2084 UINT filecount, i, len; |
2065 POINT point; | 2085 POINT point; |
2066 char* filename; | 2086 char* filename; |
2116 event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); | 2136 event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); |
2117 mswindows_enqueue_dispatch_event (emacs_event); | 2137 mswindows_enqueue_dispatch_event (emacs_event); |
2118 UNGCPRO; | 2138 UNGCPRO; |
2119 } | 2139 } |
2120 break; | 2140 break; |
2121 | 2141 #endif |
2122 | 2142 |
2123 defproc: | 2143 defproc: |
2124 default: | 2144 default: |
2125 return DefWindowProc (hwnd, message, wParam, lParam); | 2145 return DefWindowProc (hwnd, message, wParam, lParam); |
2126 } | 2146 } |