Changeset 106 for trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETextEdit.c
- Timestamp:
- 03/08/03 03:15:01 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETextEdit.c
r79 r106 13 13 #include "ICeCoffEEConfig.h" 14 14 #include "ICeCoffEEShared.h" 15 #include "ICeCoffEEActionMenu.h"16 15 #include <ApplicationEnhancer/ApplicationEnhancer.h> 17 16 … … 24 23 // Private function prototypes 25 24 //----------------------------------------------------------------------------- 26 void ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, Boolean optionKey);27 OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, Boolean optionKey);25 void ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, iccfURLAction action); 26 OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, iccfURLAction action); 28 27 29 28 //============================================================================= 30 29 // ICCF_LaunchURLFromTEClick : TEClick addition. 31 30 //----------------------------------------------------------------------------- 32 void ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, Boolean optionKey)31 void ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, iccfURLAction action) 33 32 { 34 33 OSStatus err; … … 40 39 oldSelEnd = (**teH).selEnd; 41 40 } 42 err = ICCF_DoCommandClick(teH, oldSelStart, oldSelEnd, optionKey);41 err = ICCF_DoCommandClick(teH, oldSelStart, oldSelEnd, action); 43 42 if (err != noErr && err != userCanceledErr) { 44 43 ICapeprintf("ICCF_DoCommandClick failed: %ld\n", err); … … 106 105 // ICCF_DoCommandClick : Handle the click. 107 106 //----------------------------------------------------------------------------- 108 OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, Boolean optionKey)107 OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, iccfURLAction action) 109 108 { 110 109 ICInstance inst = NULL; … … 130 129 if (thePort != NULL) QDFlushPortBuffer(thePort, NULL); 131 130 132 if (optionKey) { 133 Handle urlH = NewHandle(0); 134 if (urlH == NULL) { 135 err = MemError(); 136 } else { 137 err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH); 138 if (err == noErr) { 139 if (needsSlashes) ICCF_AddSlashes(urlH, hint); 140 err = ICCF_DoURLActionMenu(inst, hint, *urlH, 0, GetHandleSize(urlH)); 141 } 142 DisposeHandle(urlH); 131 Handle urlH = NewHandle(0); 132 if (urlH == NULL) { 133 err = MemError(); 134 } else { 135 err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH); 136 if (err == noErr) { 137 if (needsSlashes) ICCF_AddSlashes(urlH, hint); 138 err = ICCF_DoURLAction(inst, hint, *urlH, 0, GetHandleSize(urlH), action); 143 139 } 144 } else { 145 if (needsSlashes) { 146 Handle urlH = NewHandle(0); 147 err = ICParseURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd, urlH); 148 if (err == noErr) { 149 ICCF_AddSlashes(urlH, hint); 150 // don't want to disturb text selection 151 long tmpEnd = GetHandleSize(urlH); 152 long tmpStart = 0; 153 err = ICLaunchURL(inst, hint, *urlH, GetHandleSize(urlH), &tmpStart, &tmpEnd); 154 } 155 } else { 156 err = ICLaunchURL(inst, hint, *textH, GetHandleSize(textH), &selStart, &selEnd); 157 } 140 DisposeHandle(urlH); 158 141 } 159 142 … … 196 179 // Do our thing 197 180 if (modifiers & cmdKey) { 198 ICCF_LaunchURLFromTEClick(teH, oldSelStart, oldSelEnd, (modifiers & optionKey) != 0); 181 iccfURLAction action; 182 action.presentMenu = (modifiers & optionKey) != 0; 183 action.launchInBackground = (modifiers & shiftKey) != 0; 184 ICCF_LaunchURLFromTEClick(teH, oldSelStart, oldSelEnd, action); 199 185 } 200 186 ICapeprintf("ICCF_TEClick exited\n");
Note:
See TracChangeset
for help on using the changeset viewer.