summaryrefslogtreecommitdiffstats
path: root/doc/Macintosh.3
blob: 62faa62978f2bda245903fa1c4bf27b0010075e8 (plain)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
'\"
'\" Copyright (c) 1997-1998 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: Macintosh.3,v 1.4.2.1 2003/07/18 16:56:24 dgp Exp $
'\" 
.so man.macros
.TH Tcl_MacSetEventProc 3 "8.1" Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_MacSetEventProc, Tcl_MacConvertTextResource, Tcl_MacEvalResource, Tcl_MacFindResource, Tcl_GetOSTypeFromObj, Tcl_SetOSTypeObj, Tcl_NewOSTypeObj \- procedures to handle Macintosh resources and other Macintosh specifics
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
int
\fBTcl_MacEvalResource\fR(\fIinterp, resourceName, resourceNumber, fileName\fR)
.sp
char*
\fBTcl_MacConvertTextResource\fR(\fIresource\fR)
.sp
Handle
\fBTcl_MacFindResource\fR(\fIinterp, resourceType, resourceName, resourceNumber, resFileRef, releaseIt\fR)
.sp
Tcl_Obj*
\fBTcl_NewOSTypeObj\fR(\fInewOSType\fR)
.sp
void
\fBTcl_SetOSTypeObj\fR(\fIobjPtr, newOSType\fR)
.sp
int
\fBTcl_GetOSTypeFromObj\fR(\fIinterp, objPtr, osTypePtr\fR)
.sp
void
\fBTcl_MacSetEventProc\fR(\fIprocPtr\fR)
.SH ARGUMENTS
.AP Tcl_Interp *interp in
Interpreter to use for error reporting, or NULL if no error reporting is
desired.
.AP "CONST char" *resourceName in
Name of TEXT resource to source, NULL if number should be used.
.AP int resourceNumber in
Resource id of source.
.AP "CONST char" *fileName in
Name of file to process. NULL if application resource.
.AP Handle resource in
Handle to TEXT resource.
.AP long resourceType in
Type of resource to load.
.AP "CONST char" *resFileRef in
Registered resource file reference, NULL if searching all open resource files.
.AP int *releaseIt out
Should we release this resource when done.
.AP int newOSType in
Int used to initialize the new object or set the object's value.
.AP Tcl_Obj *objPtr in
Object whose internal representation is to be set or retrieved.
.AP osTypePtr out
Place to store the resulting integer.
.AP Tcl_MacConvertEventPtr procPtr in
Reference to the new function to handle all incoming Mac events.

.BE
.SH INTRODUCTION
.PP
The described routines are used to implement the Macintosh specific
\fBresource\fR command and the Mac specific notifier.. They manipulate
or use Macintosh resources and provide administration for open
resource file references.

.SH DESCRIPTION
.PP
\fBTcl_MacEvalResource\fR extends the \fBsource\fR command to
Macintosh resources.  It sources Tcl code from a Text resource.
Currently only sources the resource by name, file IDs may be supported
at a later date.
.PP
\fBTcl_MacConvertTextResource\fR converts a TEXT resource into a Tcl
suitable string. It mallocs the returned memory, converts ``\\r'' to
``\\n'', and appends a null. The caller has the responsibility for
freeing the memory.
.PP
\fBTcl_MacFindResource\fR provides a higher level interface for
loading resources. It is used by \fBresource read\fR.
.PP
\fBTcl_NewOSTypeObj\fR is used to create a new resource name type
object. The object type is "ostype".
.PP
\fBTcl_SetOSTypeObj\fR modifies an object to be a resource type and to
have the specified long value.
.PP
\fBTcl_GetOSTypeFromObj\fR attempts to return an int from the Tcl
object "objPtr". If the object is not already an int, an attempt will
be made to convert it to one.
.PP
\fBTcl_MacSetEventProc\fR sets the event handling procedure for the
application. This function will be passed all incoming Mac events.
This function usually controls the console or some other entity like
Tk.

.SH RESOURCE TYPES
.PP
Resource types are 4-byte values used by the macintosh resource
facility to tag parts of the resource fork in a file so that the OS
knows how to handle them. As all 4 bytes are restricted to printable
characters such a type can be interpreted as a 4 character string too.

.SH KEYWORDS
macintosh, mac, resource, notifier