Mercurial > emacs
comparison src/macterm.c @ 59199:d6563f85d9e5
* macterm.c (SelectionRange): Add Xcode position apple event struct.
(do_ae_open_documents): Handle Xcode-style file position open
events.
* term/mac-win.el (mac-drag-n-drop): Handle drag-n-drop events
that include line numbers.
author | Steven Tamm <steventamm@mac.com> |
---|---|
date | Thu, 30 Dec 2004 02:04:31 +0000 |
parents | 60ffced08532 |
children | 68eaccfa130a 025da3ba778e 95879cc1ed20 |
comparison
equal
deleted
inserted
replaced
59198:f7d2264f4990 | 59199:d6563f85d9e5 |
---|---|
7926 | 7926 |
7927 | 7927 |
7928 /* Called when we receive an AppleEvent with an ID of | 7928 /* Called when we receive an AppleEvent with an ID of |
7929 "kAEOpenDocuments". This routine gets the direct parameter, | 7929 "kAEOpenDocuments". This routine gets the direct parameter, |
7930 extracts the FSSpecs in it, and puts their names on a list. */ | 7930 extracts the FSSpecs in it, and puts their names on a list. */ |
7931 #pragma options align=mac68k | |
7932 typedef struct SelectionRange { | |
7933 short unused1; // 0 (not used) | |
7934 short lineNum; // line to select (<0 to specify range) | |
7935 long startRange; // start of selection range (if line < 0) | |
7936 long endRange; // end of selection range (if line < 0) | |
7937 long unused2; // 0 (not used) | |
7938 long theDate; // modification date/time | |
7939 } SelectionRange; | |
7940 #pragma options align=reset | |
7941 | |
7931 static pascal OSErr | 7942 static pascal OSErr |
7932 do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) | 7943 do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) |
7933 { | 7944 { |
7934 OSErr err, err2; | 7945 OSErr err, err2; |
7935 AEDesc the_desc; | 7946 AEDesc the_desc; |
7936 AEKeyword keyword; | 7947 AEKeyword keyword; |
7937 DescType actual_type; | 7948 DescType actual_type; |
7938 Size actual_size; | 7949 Size actual_size; |
7950 SelectionRange position; | |
7939 | 7951 |
7940 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc); | 7952 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc); |
7941 if (err != noErr) | 7953 if (err != noErr) |
7942 goto descriptor_error_exit; | 7954 goto descriptor_error_exit; |
7955 | |
7956 err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size); | |
7957 if (err == noErr) | |
7958 drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1), | |
7959 make_number (position.startRange + 1), | |
7960 make_number (position.endRange + 1)), | |
7961 drag_and_drop_file_list); | |
7943 | 7962 |
7944 /* Check to see that we got all of the required parameters from the | 7963 /* Check to see that we got all of the required parameters from the |
7945 event descriptor. For an 'odoc' event this should just be the | 7964 event descriptor. For an 'odoc' event this should just be the |
7946 file list. */ | 7965 file list. */ |
7947 err = AEGetAttributePtr(message, keyMissedKeywordAttr, typeWildCard, | 7966 err = AEGetAttributePtr(message, keyMissedKeywordAttr, typeWildCard, |