diff options
-rw-r--r-- | src/gui_mac.c | 1397 | ||||
-rw-r--r-- | src/gui_motif.c | 409 | ||||
-rw-r--r-- | src/gui_photon.c | 362 | ||||
-rw-r--r-- | src/gui_w32.c | 1093 | ||||
-rw-r--r-- | src/gui_x11.c | 367 | ||||
-rw-r--r-- | src/gui_xmdlg.c | 110 | ||||
-rw-r--r-- | src/gui_xmebw.c | 118 | ||||
-rw-r--r-- | src/version.c | 2 |
8 files changed, 1922 insertions, 1936 deletions
diff --git a/src/gui_mac.c b/src/gui_mac.c index 185cdee28e..3dfb939e29 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -28,25 +28,26 @@ * */ -/* TODO (Jussi) +/* + * TODO (Jussi) * * Clipboard does not work (at least some cases) * * ATSU font rendering has some problems * * Investigate and remove dead code (there is still lots of that) */ -#include <Devices.h> /* included first to avoid CR problems */ +#include <Devices.h> // included first to avoid CR problems #include "vim.h" #define USE_CARBONIZED -#define USE_AEVENT /* Enable AEVENT */ -#undef USE_OFFSETED_WINDOW /* Debugging feature: start Vim window OFFSETed */ +#define USE_AEVENT // Enable AEVENT +#undef USE_OFFSETED_WINDOW // Debugging feature: start Vim window OFFSETed -/* Compile as CodeWarrior External Editor */ +// Compile as CodeWarrior External Editor #if defined(FEAT_CW_EDITOR) && !defined(USE_AEVENT) -# define USE_AEVENT /* Need Apple Event Support */ +# define USE_AEVENT // Need Apple Event Support #endif -/* Vim's Scrap flavor. */ +// Vim's Scrap flavor. #define VIMSCRAPFLAVOR 'VIM!' #define SCRAPTEXTFLAVOR kScrapFlavorTypeUnicode @@ -58,7 +59,7 @@ SInt32 gMacSystemVersion; static int im_is_active = FALSE; # if 0 - /* TODO: Implement me! */ + // TODO: Implement me! static int im_start_row = 0; static int im_start_col = 0; # endif @@ -86,7 +87,7 @@ static pascal OSStatus gui_mac_unicode_key_event( #endif -/* Include some file. TODO: move into os_mac.h */ +// Include some file. TODO: move into os_mac.h #include <Menus.h> #include <Resources.h> #include <Processes.h> @@ -97,13 +98,13 @@ static pascal OSStatus gui_mac_unicode_key_event( # include <Gestalt.h> #if UNIVERSAL_INTERFACES_VERSION >= 0x0330 # include <ControlDefinitions.h> -# include <Navigation.h> /* Navigation only part of ?? */ +# include <Navigation.h> // Navigation only part of ?? #endif -/* Help Manager (balloon.h, HM prefixed functions) are not supported - * under Carbon (Jussi) */ +// Help Manager (balloon.h, HM prefixed functions) are not supported +// under Carbon (Jussi) # if 0 -/* New Help Interface for Mac, not implemented yet.*/ +// New Help Interface for Mac, not implemented yet. # include <MacHelp.h> # endif @@ -112,7 +113,7 @@ static pascal OSStatus gui_mac_unicode_key_event( * headers? (Jussi) */ #define kNothing 0 -#define kCreateEmpty 2 /*1*/ +#define kCreateEmpty 2 //1 #define kCreateRect 2 #define kDestroy 3 @@ -123,34 +124,33 @@ static pascal OSStatus gui_mac_unicode_key_event( #define botRight(r) (((Point*)&(r))[1]) -/* Time of last mouse click, to detect double-click */ +// Time of last mouse click, to detect double-click static long lastMouseTick = 0; -/* ??? */ +// ??? static RgnHandle cursorRgn; static RgnHandle dragRgn; static Rect dragRect; static short dragRectEnbl; static short dragRectControl; -/* This variable is set when waiting for an event, which is the only moment - * scrollbar dragging can be done directly. It's not allowed while commands - * are executed, because it may move the cursor and that may cause unexpected - * problems (e.g., while ":s" is working). - */ +// This variable is set when waiting for an event, which is the only moment +// scrollbar dragging can be done directly. It's not allowed while commands +// are executed, because it may move the cursor and that may cause unexpected +// problems (e.g., while ":s" is working). static int allow_scrollbar = FALSE; -/* Last mouse click caused contextual menu, (to provide proper release) */ +// Last mouse click caused contextual menu, (to provide proper release) static short clickIsPopup; -/* Feedback Action for Scrollbar */ +// Feedback Action for Scrollbar ControlActionUPP gScrollAction; ControlActionUPP gScrollDrag; -/* Keeping track of which scrollbar is being dragged */ +// Keeping track of which scrollbar is being dragged static ControlHandle dragged_sb = NULL; -/* Vector of char_u --> control index for hotkeys in dialogs */ +// Vector of char_u --> control index for hotkeys in dialogs static short *gDialogHotKeys; static struct @@ -170,23 +170,23 @@ Boolean gIsFontFallbackSet; UInt32 useAntialias_cached = 0x0; #endif -/* Colors Macros */ +// Colors Macros #define RGB(r,g,b) ((r) << 16) + ((g) << 8) + (b) #define Red(c) ((c & 0x00FF0000) >> 16) #define Green(c) ((c & 0x0000FF00) >> 8) #define Blue(c) ((c & 0x000000FF) >> 0) -/* Key mapping */ +// Key mapping -#define vk_Esc 0x35 /* -> 1B */ +#define vk_Esc 0x35 // -> 1B -#define vk_F1 0x7A /* -> 10 */ -#define vk_F2 0x78 /*0x63*/ -#define vk_F3 0x63 /*0x76*/ -#define vk_F4 0x76 /*0x60*/ -#define vk_F5 0x60 /*0x61*/ -#define vk_F6 0x61 /*0x62*/ -#define vk_F7 0x62 /*0x63*/ /*?*/ +#define vk_F1 0x7A // -> 10 +#define vk_F2 0x78 //0x63 +#define vk_F3 0x63 //0x76 +#define vk_F4 0x76 //0x60 +#define vk_F5 0x60 //0x61 +#define vk_F6 0x61 //0x62 +#define vk_F7 0x62 //0x63 ? #define vk_F8 0x64 #define vk_F9 0x65 #define vk_F10 0x6D @@ -196,26 +196,26 @@ UInt32 useAntialias_cached = 0x0; #define vk_F14 0x6B #define vk_F15 0x71 -#define vk_Clr 0x47 /* -> 1B (ESC) */ -#define vk_Enter 0x4C /* -> 03 */ +#define vk_Clr 0x47 // -> 1B (ESC) +#define vk_Enter 0x4C // -> 03 -#define vk_Space 0x31 /* -> 20 */ -#define vk_Tab 0x30 /* -> 09 */ -#define vk_Return 0x24 /* -> 0D */ -/* This is wrong for OSX, what is it for? */ -#define vk_Delete 0X08 /* -> 08 BackSpace */ +#define vk_Space 0x31 // -> 20 +#define vk_Tab 0x30 // -> 09 +#define vk_Return 0x24 // -> 0D +// This is wrong for OSX, what is it for? +#define vk_Delete 0X08 // -> 08 BackSpace -#define vk_Help 0x72 /* -> 05 */ -#define vk_Home 0x73 /* -> 01 */ -#define vk_PageUp 0x74 /* -> 0D */ -#define vk_FwdDelete 0x75 /* -> 7F */ -#define vk_End 0x77 /* -> 04 */ -#define vk_PageDown 0x79 /* -> 0C */ +#define vk_Help 0x72 // -> 05 +#define vk_Home 0x73 // -> 01 +#define vk_PageUp 0x74 // -> 0D +#define vk_FwdDelete 0x75 // -> 7F +#define vk_End 0x77 // -> 04 +#define vk_PageDown 0x79 // -> 0C -#define vk_Up 0x7E /* -> 1E */ -#define vk_Down 0x7D /* -> 1F */ -#define vk_Left 0x7B /* -> 1C */ -#define vk_Right 0x7C /* -> 1D */ +#define vk_Up 0x7E // -> 1E +#define vk_Down 0x7D // -> 1F +#define vk_Left 0x7B // -> 1C +#define vk_Right 0x7C // -> 1D #define vk_Undo vk_F1 #define vk_Cut vk_F2 @@ -258,22 +258,22 @@ static struct {vk_F14, 'F', '4'}, {vk_F15, 'F', '5'}, -/* {XK_Help, '%', '1'}, */ -/* {XK_Undo, '&', '8'}, */ -/* {XK_BackSpace, 'k', 'b'}, */ -/* {vk_Delete, 'k', 'b'}, */ +// {XK_Help, '%', '1'}, +// {XK_Undo, '&', '8'}, +// {XK_BackSpace, 'k', 'b'}, +// {vk_Delete, 'k', 'b'}, {vk_Insert, 'k', 'I'}, {vk_FwdDelete, 'k', 'D'}, {vk_Home, 'k', 'h'}, {vk_End, '@', '7'}, -/* {XK_Prior, 'k', 'P'}, */ -/* {XK_Next, 'k', 'N'}, */ -/* {XK_Print, '%', '9'}, */ +// {XK_Prior, 'k', 'P'}, +// {XK_Next, 'k', 'N'}, +// {XK_Print, '%', '9'}, {vk_PageUp, 'k', 'P'}, {vk_PageDown, 'k', 'N'}, - /* End of list marker: */ + // End of list marker: {(KeySym)0, 0, 0} }; @@ -321,7 +321,7 @@ C2Pascal_save(char_u *Cstring) len = STRLEN(Cstring); - if (len > 255) /* Truncate if necessary */ + if (len > 255) // Truncate if necessary len = 255; PascalString = alloc(len + 1); @@ -351,7 +351,7 @@ C2Pascal_save_and_remove_backslash(char_u *Cstring) len = STRLEN(Cstring); - if (len > 255) /* Truncate if necessary */ + if (len > 255) // Truncate if necessary len = 255; PascalString = alloc(len + 1); @@ -387,8 +387,8 @@ EventModifiers2VimMouseModifiers(EventModifiers macModifiers) if (macModifiers & (optionKey | rightOptionKey)) vimModifiers |= MOUSE_ALT; #if 0 - /* Not yet supported */ - if (macModifiers & (cmdKey)) /* There's no rightCmdKey */ + // Not yet supported + if (macModifiers & (cmdKey)) // There's no rightCmdKey vimModifiers |= MOUSE_CMD; #endif return (vimModifiers); @@ -410,13 +410,14 @@ EventModifiers2VimModifiers(EventModifiers macModifiers) if (macModifiers & (optionKey | rightOptionKey)) vimModifiers |= MOD_MASK_ALT; #ifdef USE_CMD_KEY - if (macModifiers & (cmdKey)) /* There's no rightCmdKey */ + if (macModifiers & (cmdKey)) // There's no rightCmdKey vimModifiers |= MOD_MASK_CMD; #endif return (vimModifiers); } -/* Convert a string representing a point size into pixels. The string should +/* + * Convert a string representing a point size into pixels. The string should * be a positive decimal number, with an optional decimal point (eg, "12", or * "10.5"). The pixel value is returned, and a pointer to the next unconverted * character is stored in *end. The flag "vertical" says whether this @@ -435,7 +436,7 @@ points_to_pixels(char_u *str, char_u **end, int vertical) { if (*str == '.' && divisor == 0) { - /* Start keeping a divisor, for later */ + // Start keeping a divisor, for later divisor = 1; continue; } @@ -479,8 +480,8 @@ menu_title_removing_mnemonic(vimmenu_T *menu) if (name) { - /* Simple mnemonic-removal algorithm, assumes single parenthesized - * mnemonic character towards the end of the menu text */ + // Simple mnemonic-removal algorithm, assumes single parenthesized + // mnemonic character towards the end of the menu text mnemonicStart = CFStringFind(name, CFSTR("("), kCFCompareBackwards); displayLen = CFStringGetLength(name); @@ -530,33 +531,33 @@ new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error) AEKeyword dummyKeyword; DescType dummyType; - /* Get number of files in list */ + // Get number of files in list *error = AECountItems(theList, numFiles); if (*error) return fnames; - /* Allocate the pointer list */ + // Allocate the pointer list fnames = ALLOC_MULT(char_u *, *numFiles); - /* Empty out the list */ + // Empty out the list for (fileCount = 0; fileCount < *numFiles; fileCount++) fnames[fileCount] = NULL; - /* Scan the list of FSSpec */ + // Scan the list of FSSpec for (fileCount = 1; fileCount <= *numFiles; fileCount++) { - /* Get the alias for the nth file, convert to an FSSpec */ + // Get the alias for the nth file, convert to an FSSpec newError = AEGetNthPtr(theList, fileCount, typeFSS, &dummyKeyword, &dummyType, (Ptr) &fileToOpen, sizeof(FSSpec), &actualSize); if (newError) { - /* Caller is able to clean up */ - /* TODO: Should be clean up or not? For safety. */ + // Caller is able to clean up + // TODO: Should be clean up or not? For safety. return fnames; } - /* Convert the FSSpec to a pathname */ + // Convert the FSSpec to a pathname fnames[fileCount - 1] = FullPathFromFSSpec_save(fileToOpen); } @@ -595,7 +596,7 @@ new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error) */ typedef struct WindowSearch WindowSearch; -struct WindowSearch /* for handling class 'KAHL', event 'SRCH', keyDirectObject typeChar*/ +struct WindowSearch // for handling class 'KAHL', event 'SRCH', keyDirectObject typeChar { FSSpec theFile; // identifies the file long *theDate; // where to put the modification date/time @@ -668,7 +669,7 @@ Handle_KAHL_SRCH_AE( */ typedef struct ModificationInfo ModificationInfo; -struct ModificationInfo /* for replying to class 'KAHL', event 'MOD ', keyDirectObject typeAEList*/ +struct ModificationInfo // for replying to class 'KAHL', event 'MOD ', keyDirectObject typeAEList { FSSpec theFile; // identifies the file long theDate; // the date/time the file was last modified @@ -693,11 +694,11 @@ Handle_KAHL_MOD_AE( if (error) return error; - /* Send the reply */ -/* replyObject.descriptorType = typeNull; - replyObject.dataHandle = nil;*/ + // Send the reply +// replyObject.descriptorType = typeNull; +// replyObject.dataHandle = nil; -/* AECreateDesc(typeChar, (Ptr)&title[1], title[0], &data) */ +// AECreateDesc(typeChar, (Ptr)&title[1], title[0], &data) error = AECreateList(nil, 0, false, &replyList); if (error) return error; @@ -705,22 +706,21 @@ Handle_KAHL_MOD_AE( #if 0 error = AECountItems(&replyList, &numFiles); - /* AEPutKeyDesc(&replyList, keyAEPnject, &aDesc) - * AEPutKeyPtr(&replyList, keyAEPosition, typeChar, (Ptr)&theType, - * sizeof(DescType)) - */ + // AEPutKeyDesc(&replyList, keyAEPnject, &aDesc) + // AEPutKeyPtr(&replyList, keyAEPosition, typeChar, (Ptr)&theType, + // sizeof(DescType)) - /* AEPutDesc */ + // AEPutDesc #endif numFiles = 0; FOR_ALL_BUFFERS(buf) if (buf->b_ml.ml_mfp != NULL) { - /* Add this file to the list */ + // Add this file to the list theFile.theFile = buf->b_FSSpec; theFile.theDate = buf->b_mtime; -/* theFile.theDate = time(NULL) & (time_t) 0xFFFFFFF0; */ +// theFile.theDate = time(NULL) & (time_t) 0xFFFFFFF0; error = AEPutPtr(&replyList, numFiles, typeChar, (Ptr) &theFile, sizeof(theFile)); }; @@ -728,7 +728,7 @@ Handle_KAHL_MOD_AE( error = AECountItems(&replyList, &numFiles); #endif - /* We can add data only if something to reply */ + // We can add data only if something to reply error = AEPutParamDesc(theReply, keyDirectObject, &replyList); if (replyList.dataHandle) @@ -764,12 +764,12 @@ Handle_KAHL_MOD_AE( */ typedef struct CW_GetText CW_GetText; -struct CW_GetText /* for handling class 'KAHL', event 'GTTX', keyDirectObject typeChar*/ +struct CW_GetText // for handling class 'KAHL', event 'GTTX', keyDirectObject typeChar { - FSSpec theFile; /* identifies the file */ - Handle theText; /* the location where you return the text (must be resized properly) */ - long *unused; /* 0 (not used) */ - long *theDate; /* where to put the modification date/time */ + FSSpec theFile; // identifies the file + Handle theText; // the location where you return the text (must be resized properly) + long *unused; // 0 (not used) + long *theDate; // where to put the modification date/time }; pascal OSErr @@ -806,19 +806,19 @@ Handle_KAHL_GTTX_AE( if (foundFile) { - BufferSize = 0; /* GetHandleSize(GetTextData.theText); */ + BufferSize = 0; // GetHandleSize(GetTextData.theText); for (lineno = 0; lineno <= buf->b_ml.ml_line_count; lineno++) { - /* Must use the right buffer */ + // Must use the right buffer line = ml_get_buf(buf, (linenr_T) lineno, FALSE); linesize = STRLEN(line) + 1; lineStart = BufferSize; BufferSize += linesize; - /* Resize handle to linesize+1 to include the linefeed */ + // Resize handle to linesize+1 to include the linefeed SetHandleSize(GetTextData.theText, BufferSize); if (GetHandleSize(GetTextData.theText) != BufferSize) { - break; /* Simple handling for now */ + break; // Simple handling for now } else { @@ -838,7 +838,7 @@ Handle_KAHL_GTTX_AE( if (foundFile == false) *GetTextData.theDate = fnfErr; else -/* *GetTextData.theDate = time(NULL) & (time_t) 0xFFFFFFF0;*/ +// *GetTextData.theDate = time(NULL) & (time_t) 0xFFFFFFF0; *GetTextData.theDate = buf->b_mtime; } @@ -851,7 +851,9 @@ Handle_KAHL_GTTX_AE( * */ -/* Taken from MoreAppleEvents:ProcessHelpers*/ +/* + * Taken from MoreAppleEvents:ProcessHelpers + */ pascal OSErr FindProcessBySignature( const OSType targetType, @@ -915,7 +917,7 @@ Send_KAHL_MOD_AE(buf_T *buf) AEDisposeDesc(&targetAppDesc); - /* Add the parms */ + // Add the parms ModData.theFile = buf->b_FSSpec; ModData.theDate = buf->b_mtime; @@ -931,12 +933,12 @@ Send_KAHL_MOD_AE(buf_T *buf) anErr = AESend(&theEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, idleProcUPP, nil); if (anErr == noErr && sendMode == kAEWaitReply) { -/* anErr = AEHGetHandlerError(&theReply);*/ +// anErr = AEHGetHandlerError(&theReply); } (void) AEDisposeDesc(&theReply); } } -#endif /* FEAT_CW_EDITOR */ +#endif // FEAT_CW_EDITOR /* * ------------------------------------------------------------ @@ -957,13 +959,13 @@ HandleUnusedParms(const AppleEvent *theAEvent) DescType dummyType; AEKeyword missedKeyword; - /* Get the "missed keyword" attribute from the AppleEvent. */ + // Get the "missed keyword" attribute from the AppleEvent. error = AEGetAttributePtr(theAEvent, keyMissedKeywordAttr, typeKeyword, &dummyType, (Ptr)&missedKeyword, sizeof(missedKeyword), &actualSize); - /* If the descriptor isn't found, then we got the required parameters. */ + // If the descriptor isn't found, then we got the required parameters. if (error == errAEDescNotFound) { error = noErr; @@ -971,7 +973,7 @@ HandleUnusedParms(const AppleEvent *theAEvent) else { #if 0 - /* Why is this removed? */ + // Why is this removed? error = errAEEventNotHandled; #endif } @@ -988,7 +990,7 @@ HandleUnusedParms(const AppleEvent *theAEvent) */ typedef struct SelectionRange SelectionRange; -struct SelectionRange /* for handling kCoreClassEvent:kOpenDocuments:keyAEPosition typeChar */ +struct SelectionRange // for handling kCoreClassEvent:kOpenDocuments:keyAEPosition typeChar { short unused1; // 0 (not used) short lineNum; // line to select (<0 to specify range) @@ -1005,30 +1007,30 @@ static SelectionRange drop_thePosition; static void drop_callback(void *cookie UNUSED) { - /* TODO: Handle the goto/select line more cleanly */ + // TODO: Handle the goto/select line more cleanly if ((drop_numFiles == 1) & (drop_gotPosition)) { if (drop_thePosition.lineNum >= 0) { lnum = drop_thePosition.lineNum + 1; - /* oap->motion_type = MLINE; - setpcmark();*/ + // oap->motion_type = MLINE; + // setpcmark(); if (lnum < 1L) lnum = 1L; else if (lnum > curbuf->b_ml.ml_line_count) lnum = curbuf->b_ml.ml_line_count; curwin->w_cursor.lnum = lnum; curwin->w_cursor.col = 0; - /* beginline(BL_SOL | BL_FIX);*/ + // beginline(BL_SOL | BL_FIX); } else goto_byte(drop_thePosition.startRange + 1); } - /* Update the screen display */ + // Update the screen display update_screen(NOT_VALID); - /* Select the text if possible */ + // Select the text if possible if (drop_gotPosition) { VIsual_active = TRUE; @@ -1047,14 +1049,14 @@ drop_callback(void *cookie UNUSED) } } -/* The IDE uses the optional keyAEPosition parameter to tell the ed- - itor the selection range. If lineNum is zero or greater, scroll the text - to the specified line. If lineNum is less than zero, use the values in - startRange and endRange to select the specified characters. Scroll - the text to display the selection. If lineNum, startRange, and - endRange are all negative, there is no selection range specified. +/* + * The IDE uses the optional keyAEPosition parameter to tell the ed- + * itor the selection range. If lineNum is zero or greater, scroll the text + * to the specified line. If lineNum is less than zero, use the values in + * startRange and endRange to select the specified characters. Scroll + * the text to display the selection. If lineNum, startRange, and + * endRange are all negative, there is no selection range specified. */ - pascal OSErr HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) { @@ -1076,7 +1078,7 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) short gotPosition = false; long lnum; - /* the direct object parameter is the list of aliases to files (one or more) */ + // the direct object parameter is the list of aliases to files (one or more) error = AEGetParamDesc(theAEvent, keyDirectObject, typeAEList, &theList); if (error) return error; @@ -1111,7 +1113,7 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) if (error) { - /* TODO: empty fnames[] first */ + // TODO: empty fnames[] first vim_free(fnames); return (error); } @@ -1122,7 +1124,7 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) char_u *p; int fnum = -1; - /* these are the initial files dropped on the Vim icon */ + // these are the initial files dropped on the Vim icon for (i = 0 ; i < numFiles; i++) { if (ga_grow(&global_alist.al_ga, 1) == FAIL @@ -1134,8 +1136,8 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) fnum = GARGLIST[GARGCOUNT - 1].ae_fnum; } - /* If the file name was already in the buffer list we need to switch - * to it. */ + // If the file name was already in the buffer list we need to switch + // to it. if (curbuf->b_fnum != fnum) { char_u cmd[30]; @@ -1144,7 +1146,7 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) do_cmdline_cmd(cmd); } - /* Change directory to the location of the first file. */ + // Change directory to the location of the first file. if (GARGCOUNT > 0 && vim_chdirfile(alist_name(&GARGLIST[0]), "drop") == OK) shorten_fnames(TRUE); @@ -1152,7 +1154,7 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) goto finished; } - /* Handle the drop, :edit to get to the file */ + // Handle the drop, :edit to get to the file drop_numFiles = numFiles; drop_gotPosition = gotPosition; drop_thePosition = thePosition; @@ -1161,11 +1163,11 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) setcursor(); out_flush(); - /* Fake mouse event to wake from stall */ + // Fake mouse event to wake from stall PostEvent(mouseUp, 0); finished: - AEDisposeDesc(&theList); /* dispose what we allocated */ + AEDisposeDesc(&theList); // dispose what we allocated error = HandleUnusedParms(theAEvent); return error; @@ -1174,7 +1176,6 @@ finished: /* * */ - pascal OSErr Handle_aevt_oapp_AE( const AppleEvent *theAEvent, @@ -1190,7 +1191,6 @@ Handle_aevt_oapp_AE( /* * */ - pascal OSErr Handle_aevt_quit_AE( const AppleEvent *theAEvent, @@ -1203,7 +1203,7 @@ Handle_aevt_quit_AE( if (error) return error; - /* Need to fake a :confirm qa */ + // Need to fake a :confirm qa do_cmdline_cmd((char_u *)"confirm qa"); return error; @@ -1212,7 +1212,6 @@ Handle_aevt_quit_AE( /* * */ - pascal OSErr Handle_aevt_pdoc_AE( const AppleEvent *theAEvent, @@ -1253,30 +1252,31 @@ InstallAEHandlers(void) { OSErr error; - /* install open application handler */ + // install open application handler error = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, NewAEEventHandlerUPP(Handle_aevt_oapp_AE), 0, false); if (error) return error; - /* install quit application handler */ + // install quit application handler error = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(Handle_aevt_quit_AE), 0, false); if (error) return error; - /* install open document handler */ + // install open document handler error = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerUPP(HandleODocAE), 0, false); if (error) return error; - /* install print document handler */ + // install print document handler error = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, NewAEEventHandlerUPP(Handle_aevt_pdoc_AE), 0, false); -/* Install Core Suite */ -/* error = AEInstallEventHandler(kAECoreSuite, kAEClone, +// Install Core Suite +#if 0 + error = AEInstallEventHandler(kAECoreSuite, kAEClone, NewAEEventHandlerUPP(Handle_unknown_AE), nil, false); error = AEInstallEventHandler(kAECoreSuite, kAEClose, @@ -1314,7 +1314,7 @@ InstallAEHandlers(void) error = AEInstallEventHandler(kAECoreSuite, kAESetData, NewAEEventHandlerUPP(Handle_unknown_AE), nil, false); -*/ +#endif #ifdef FEAT_CW_EDITOR /* @@ -1335,7 +1335,7 @@ InstallAEHandlers(void) return error; } -#endif /* USE_AEVENT */ +#endif // USE_AEVENT /* @@ -1361,7 +1361,7 @@ FontPanelHandler( FMFontSize newSize; FMFontStyle newStyle; - /* Retrieve the font family ID number. */ + // Retrieve the font family ID number. status = GetEventParameter(inEvent, kEventParamFMFontFamily, /*inDesiredType=*/typeFMFontFamily, /*outActualType=*/NULL, /*inBufferSize=*/sizeof(FMFontFamily), /*outActualSize=*/NULL, @@ -1369,13 +1369,13 @@ FontPanelHandler( if (status == noErr) gFontPanelInfo.family = newFamily; - /* Retrieve the font size. */ + // Retrieve the font size. status = GetEventParameter(inEvent, kEventParamFMFontSize, typeFMFontSize, NULL, sizeof(FMFontSize), NULL, &newSize); if (status == noErr) gFontPanelInfo.size = newSize; - /* Retrieve the font style (bold, etc.). Currently unused. */ + // Retrieve the font style (bold, etc.). Currently unused. status = GetEventParameter(inEvent, kEventParamFMFontStyle, typeFMFontStyle, NULL, sizeof(FMFontStyle), NULL, &newStyle); if (status == noErr) @@ -1390,7 +1390,7 @@ InstallFontPanelHandler(void) { EventTypeSpec eventTypes[2]; EventHandlerUPP handlerUPP; - /* EventHandlerRef handlerRef; */ + // EventHandlerRef handlerRef; eventTypes[0].eventClass = kEventClassFont; eventTypes[0].eventKind = kEventFontSelection; @@ -1422,20 +1422,20 @@ GetFontPanelSelection(char_u *outName) if (FMGetFontFamilyName(gFontPanelInfo.family, buf) == noErr) { - /* Canonicalize localized font names */ + // Canonicalize localized font names if (FMGetFontFromFontFamilyInstance(gFontPanelInfo.family, gFontPanelInfo.style, &fid, NULL) != noErr) return; - /* Request font name with Mac encoding (otherwise we could - * get an unwanted utf-16 name) */ + // Request font name with Mac encoding (otherwise we could + // get an unwanted utf-16 name) if (ATSUFindFontName(fid, kFontFullName, kFontMacintoshPlatform, kFontNoScriptCode, kFontNoLanguageCode, 255, (char *)outName, &fontNameLen, NULL) != noErr) return; - /* Only encode font size, because style (bold, italic, etc) is - * already part of the font full name */ + // Only encode font size, because style (bold, italic, etc) is + // already part of the font full name vim_snprintf((char *)styleString, FONT_STYLE_BUFFER_SIZE, ":h%d", gFontPanelInfo.size/*, ((gFontPanelInfo.style & bold)!=0 ? ":b" : ""), @@ -1463,23 +1463,22 @@ GetFontPanelSelection(char_u *outName) * * Returns the index inside the menu where */ - short /* Should we return MenuItemIndex? */ + short // Should we return MenuItemIndex? gui_mac_get_menu_item_index(vimmenu_T *pMenu) { short index; short itemIndex = -1; vimmenu_T *pBrother; - /* Only menu without parent are the: - * -menu in the menubar - * -popup menu - * -toolbar (guess) - * - * Which are not items anyway. - */ + // Only menu without parent are the: + // -menu in the menubar + // -popup menu + // -toolbar (guess) + // + // Which are not items anyway. if (pMenu->parent) { - /* Start from the Oldest Brother */ + // Start from the Oldest Brother pBrother = pMenu->parent->children; index = 1; while ((pBrother) && (itemIndex == -1)) @@ -1501,13 +1500,12 @@ gui_mac_get_vim_menu(short menuID, short itemIndex, vimmenu_T *pMenu) vimmenu_T *pElder = pMenu->parent; - /* Only menu without parent are the: - * -menu in the menubar - * -popup menu - * -toolbar (guess) - * - * Which are not items anyway. - */ + // Only menu without parent are the: + // -menu in the menubar + // -popup menu + // -toolbar (guess) + // + // Which are not items anyway. if ((pElder) && (pElder->submenu_id == menuID)) { @@ -1554,12 +1552,12 @@ gui_mac_drag_thumb(ControlHandle theControl, short partCode) if (sb == NULL) return; - /* Need to find value by diff between Old Poss New Pos */ + // Need to find value by diff between Old Poss New Pos value = GetControl32BitValue(theControlToUse); dragging = (partCode != 0); - /* When "allow_scrollbar" is FALSE still need to remember the new - * position, but don't actually scroll by setting "dont_scroll". */ + // When "allow_scrollbar" is FALSE still need to remember the new + // position, but don't actually scroll by setting "dont_scroll". dont_scroll = !allow_scrollbar; gui_drag_scrollbar(sb, value, dragging); dont_scroll = dont_scroll_save; @@ -1569,7 +1567,7 @@ gui_mac_drag_thumb(ControlHandle theControl, short partCode) void gui_mac_scroll_action(ControlHandle theControl, short partCode) { - /* TODO: have live support */ + // TODO: have live support scrollbar_T *sb, *sb_info; long data; long value; @@ -1582,7 +1580,7 @@ gui_mac_scroll_action(ControlHandle theControl, short partCode) if (sb == NULL) return; - if (sb->wp != NULL) /* Left or right scrollbar */ + if (sb->wp != NULL) // Left or right scrollbar { /* * Careful: need to get scrollbar info out of first (left) scrollbar @@ -1592,11 +1590,11 @@ gui_mac_scroll_action(ControlHandle theControl, short partCode) sb_info = &sb->wp->w_scrollbars[0]; if (sb_info->size > 5) - page = sb_info->size - 2; /* use two lines of context */ + page = sb_info->size - 2; // use two lines of context else page = sb_info->size; } - else /* Bottom scrollbar */ + else // Bottom scrollbar { sb_info = sb; page = curwin->w_width - 5; @@ -1612,13 +1610,13 @@ gui_mac_scroll_action(ControlHandle theControl, short partCode) } value = sb_info->value + data; -/* if (value > sb_info->max) - value = sb_info->max; - else if (value < 0) - value = 0;*/ +// if (value > sb_info->max) +// value = sb_info->max; +// else if (value < 0) +// value = 0; - /* When "allow_scrollbar" is FALSE still need to remember the new - * position, but don't actually scroll by setting "dont_scroll". */ + // When "allow_scrollbar" is FALSE still need to remember the new + // position, but don't actually scroll by setting "dont_scroll". dont_scroll = !allow_scrollbar; gui_drag_scrollbar(sb, value, dragging); dont_scroll = dont_scroll_save; @@ -1626,7 +1624,8 @@ gui_mac_scroll_action(ControlHandle theControl, short partCode) out_flush(); gui_mch_set_scrollbar_thumb(sb, value, sb_info->size, sb_info->max); -/* if (sb_info->wp != NULL) +#if 0 + if (sb_info->wp != NULL) { win_T *wp; int sb_num; @@ -1642,7 +1641,8 @@ gui_mac_scroll_action(ControlHandle theControl, short partCode) gui_do_scroll(); gui_mch_set_scrollbar_thumb(sb, value, sb_info->size, sb_info->max); } - }*/ + } +#endif } /* @@ -1676,7 +1676,7 @@ gui_mac_doInContentClick(EventRecord *theEvent, WindowPtr whichWindow) if (theControl != NUL) { - /* We hit a scrollbar */ + // We hit a scrollbar if (thePortion != kControlIndicatorPart) { @@ -1692,24 +1692,24 @@ gui_mac_doInContentClick(EventRecord *theEvent, WindowPtr whichWindow) #else TrackControl(theControl, thePoint, NULL); #endif - /* pass 0 as the part to tell gui_mac_drag_thumb, that the mouse - * button has been released */ - gui_mac_drag_thumb(theControl, 0); /* Should it be thePortion ? (Dany) */ + // pass 0 as the part to tell gui_mac_drag_thumb, that the mouse + // button has been released + gui_mac_drag_thumb(theControl, 0); // Should it be thePortion ? (Dany) dragged_sb = NULL; } } else { - /* We are inside the contents */ + // We are inside the contents - /* Convert the CTRL, OPTION, SHIFT and CMD key */ + // Convert the CTRL, OPTION, SHIFT and CMD key vimModifiers = EventModifiers2VimMouseModifiers(theEvent->modifiers); - /* Defaults to MOUSE_LEFT as there's only one mouse button */ + // Defaults to MOUSE_LEFT as there's only one mouse button vimMouseButton = MOUSE_LEFT; - /* Convert the CTRL_MOUSE_LEFT to MOUSE_RIGHT */ - /* TODO: NEEDED? */ + // Convert the CTRL_MOUSE_LEFT to MOUSE_RIGHT + // TODO: NEEDED? clickIsPopup = FALSE; if (mouse_model_popup() && IsShowContextualMenuClick(theEvent)) @@ -1719,20 +1719,18 @@ gui_mac_doInContentClick(EventRecord *theEvent, WindowPtr whichWindow) clickIsPopup = TRUE; } - /* Is it a double click ? */ + // Is it a double click ? dblClick = ((theEvent->when - lastMouseTick) < GetDblTime()); - /* Send the mouse click to Vim */ + // Send the mouse click to Vim gui_send_mouse_event(vimMouseButton, thePoint.h, thePoint.v, dblClick, vimModifiers); - /* Create the rectangle around the cursor to detect - * the mouse dragging - */ + // Create the rectangle around the cursor to detect + // the mouse dragging #if 0 - /* TODO: Do we need to this even for the contextual menu? - * It may be require for popup_setpos, but for popup? - */ + // TODO: Do we need to this even for the contextual menu? + // It may be require for popup_setpos, but for popup? if (vimMouseButton == MOUSE_LEFT) #endif { @@ -1756,7 +1754,7 @@ gui_mac_doInDragClick(Point where, WindowPtr whichWindow) Rect movingLimits; Rect *movingLimitsPtr = &movingLimits; - /* TODO: may try to prevent move outside screen? */ + // TODO: may try to prevent move outside screen? movingLimitsPtr = GetRegionBounds(GetGrayRgn(), &movingLimits); DragWindow(whichWindow, where, movingLimitsPtr); } @@ -1777,8 +1775,8 @@ gui_mac_doInGrowClick(Point where, WindowPtr whichWindow) resizeLimitsPtr = GetRegionBounds(GetGrayRgn(), &resizeLimits); - /* Set the minimum size */ - /* TODO: Should this come from Vim? */ + // Set the minimum size |