Ignore:
Timestamp:
03/08/03 03:15:01 (19 years ago)
Author:
Nicholas Riley
Message:

ICeCoffEE 1.3.2b1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETextEdit.c

    r79 r106  
    1313#include "ICeCoffEEConfig.h"
    1414#include "ICeCoffEEShared.h"
    15 #include "ICeCoffEEActionMenu.h"
    1615#include <ApplicationEnhancer/ApplicationEnhancer.h>
    1716
     
    2423//              Private function prototypes
    2524//-----------------------------------------------------------------------------
    26 void    ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, Boolean optionKey);
    27 OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, Boolean optionKey);
     25void    ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, iccfURLAction action);
     26OSStatus ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, iccfURLAction action);
    2827
    2928//=============================================================================
    3029//              ICCF_LaunchURLFromTEClick : TEClick addition.
    3130//-----------------------------------------------------------------------------
    32 void    ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, Boolean optionKey)
     31void    ICCF_LaunchURLFromTEClick(TEHandle teH, short oldSelStart, short oldSelEnd, iccfURLAction action)
    3332{
    3433    OSStatus                    err;
     
    4039            oldSelEnd = (**teH).selEnd;
    4140        }
    42         err = ICCF_DoCommandClick(teH, oldSelStart, oldSelEnd, optionKey);
     41        err = ICCF_DoCommandClick(teH, oldSelStart, oldSelEnd, action);
    4342        if (err != noErr && err != userCanceledErr) {
    4443            ICapeprintf("ICCF_DoCommandClick failed: %ld\n", err);
     
    106105//              ICCF_DoCommandClick : Handle the click.
    107106//-----------------------------------------------------------------------------
    108 OSStatus        ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, Boolean optionKey)
     107OSStatus        ICCF_DoCommandClick(TEHandle teH, long selStart, long selEnd, iccfURLAction action)
    109108{
    110109    ICInstance inst = NULL;
     
    130129        if (thePort != NULL) QDFlushPortBuffer(thePort, NULL);
    131130
    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);
    143139            }
    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);
    158141        }
    159142       
     
    196179    // Do our thing
    197180    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);
    199185    }
    200186    ICapeprintf("ICCF_TEClick exited\n");
Note: See TracChangeset for help on using the changeset viewer.