1Tcl_MacSetEventProc(3) Tcl Library Procedures Tcl_MacSetEventProc(3)
2
3
4
5______________________________________________________________________________
6
8 Tcl_MacSetEventProc, Tcl_MacConvertTextResource, Tcl_MacEvalResource,
9 Tcl_MacFindResource, Tcl_GetOSTypeFromObj, Tcl_SetOSTypeObj,
10 Tcl_NewOSTypeObj - procedures to handle Macintosh resources and other
11 Macintosh specifics
12
14 #include <tcl.h>
15
16 int
17 Tcl_MacEvalResource(interp, resourceName, resourceNumber, fileName)
18
19 char*
20 Tcl_MacConvertTextResource(resource)
21
22 Handle
23 Tcl_MacFindResource(interp, resourceType, resourceName, resourceNumber, resFileRef, releaseIt)
24
25 Tcl_Obj*
26 Tcl_NewOSTypeObj(newOSType)
27
28 void
29 Tcl_SetOSTypeObj(objPtr, newOSType)
30
31 int
32 Tcl_GetOSTypeFromObj(interp, objPtr, osTypePtr)
33
34 void
35 Tcl_MacSetEventProc(procPtr)
36
38 Tcl_Interp *interp (in) Interpreter to use for error
39 reporting, or NULL if no
40 error reporting is desired.
41
42 CONST char *resourceName (in) Name of TEXT resource to
43 source, NULL if number should
44 be used.
45
46 int resourceNumber (in) Resource id of source.
47
48 CONST char *fileName (in) Name of file to process. NULL
49 if application resource.
50
51 Handle resource (in) Handle to TEXT resource.
52
53 long resourceType (in) Type of resource to load.
54
55 CONST char *resFileRef (in) Registered resource file ref‐
56 erence, NULL if searching all
57 open resource files.
58
59 int *releaseIt (out) Should we release this
60 resource when done.
61
62 int newOSType (in) Int used to initialize the
63 new object or set the
64 object's value.
65
66 Tcl_Obj *objPtr (in) Object whose internal repre‐
67 sentation is to be set or
68 retrieved.
69
70 osTypePtr out Place to store the resulting
71 integer.
72
73 Tcl_MacConvertEventPtr procPtr(in)
74 Reference to the new function
75 to handle all incoming Mac
76 events.
77
78_________________________________________________________________
79
81 The described routines are used to implement the Macintosh specific
82 resource command and the Mac specific notifier.. They manipulate or use
83 Macintosh resources and provide administration for open resource file
84 references.
85
86
88 Tcl_MacEvalResource extends the source command to Macintosh resources.
89 It sources Tcl code from a Text resource. Currently only sources the
90 resource by name, file IDs may be supported at a later date.
91
92 Tcl_MacConvertTextResource converts a TEXT resource into a Tcl suitable
93 string. It mallocs the returned memory, converts ``\r'' to ``\n'', and
94 appends a null. The caller has the responsibility for freeing the mem‐
95 ory.
96
97 Tcl_MacFindResource provides a higher level interface for loading
98 resources. It is used by resource read.
99
100 Tcl_NewOSTypeObj is used to create a new resource name type object. The
101 object type is "ostype".
102
103 Tcl_SetOSTypeObj modifies an object to be a resource type and to have
104 the specified long value.
105
106 Tcl_GetOSTypeFromObj attempts to return an int from the Tcl object
107 "objPtr". If the object is not already an int, an attempt will be made
108 to convert it to one.
109
110 Tcl_MacSetEventProc sets the event handling procedure for the applica‐
111 tion. This function will be passed all incoming Mac events. This func‐
112 tion usually controls the console or some other entity like Tk.
113
114
116 Resource types are 4-byte values used by the macintosh resource facil‐
117 ity to tag parts of the resource fork in a file so that the OS knows
118 how to handle them. As all 4 bytes are restricted to printable charac‐
119 ters such a type can be interpreted as a 4 character string too.
120
121
123 macintosh, mac, resource, notifier
124
125
126
127Tcl 8.1 Tcl_MacSetEventProc(3)