Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5f0e77b853
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 95 lines (73 sloc) 3.482 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
//
// SCParamBlock.h
// xDownload
//
// Created by Uli Kusterer on 20.01.07.
// Copyright 2007 Uli Kusterer.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//

/* Nice little Cocoa wrapper around the XCmdPtr. */

#import <Cocoa/Cocoa.h>
#import "SuperXCmd.h"


// Make our class name unique. SuperCard can't unload Cocoa classes, and
// there can only be one class of a particular name. The #define below will
// make sure that we can use the name SCParamBlock everywhere, but the compiler
// will actually call it SCParamBlock_xDownload. You may also want to append
// the version number here, so newer versions of your XCmd don't get the old
// classes if two projects are using different versions of your XCmd.
// You also may have to do the same for your other classes.

// Change this to your external's name:
#ifndef SCParamBlock
// put a define like '#define SCParamBlock SCParamBlock_NameOfYourXCMD' in your prefix header somewhere
#error Must define SCParamBlock to a unique name!
#endif


@interface SCParamBlock : NSObject
{
XCmdPtr paramPtr;
}

-(id) initWithXCmdBlock: (XCmdPtr)pblock;

// Parameters:
-(int) parameterCount;

-(NSString*) parameterAtIndex: (int)ind;
-(void) setParameterAtIndex: (int)ind to: (NSString*)str; // For pass-by-reference parameters.

-(NSData*) parameterDataAtIndex: (int)ind;
-(void) setParameterDataAtIndex: (int)ind to: (NSData*)theData; // For pass-by-reference parameters.

// Return value:
-(void) setReturnValue: (NSString*)str;


// Callbacks:
-(void) sendCardMessage: (NSString*)superTalkStatement;
-(void) sendSCMessage: (NSString*)superTalkStatement;
-(NSString*) evaluateExpression: (NSString*)superTalkExpression;

-(NSString*) valueForGlobal: (NSString*)globalName;
-(void) setValue: (NSString*)var forGlobal: (NSString*)globalName;

-(NSString*) valueOfFieldNamed: (NSString*)fieldName onCardLayer: (BOOL)yorn;
-(NSString*) valueOfFieldNumber: (int)num onCardLayer: (BOOL)yorn;
-(NSString*) valueOfFieldID: (int)num onCardLayer: (BOOL)yorn;

-(void) setValue: (NSString*)val forFieldNamed: (NSString*)fieldName onCardLayer: (BOOL)yorn;
-(void) setValue: (NSString*)val forFieldNumber: (int)num onCardLayer: (BOOL)yorn;
-(void) setValue: (NSString*)val forFieldID: (int)num onCardLayer: (BOOL)yorn;

// Low-level utility stuff:
+(Handle) stringHandleFromString: (NSString*)str;
+(Handle) stringHandleFromData: (NSData*)theData;

+(NSString*) stringFromStringHandle: (Handle)theHd;
+(NSData*) dataFromStringHandle: (Handle)theHd;

+(void) setStringPtr: (StringPtr)theString toString: (NSString*)str; // theString must be a variable of type Str255.

@end
Something went wrong with that request. Please try again.