Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4be9be

Browse files
committed
Three down, two to go...
1 parent ea39abd commit e4be9be

6 files changed

Lines changed: 622 additions & 0 deletions

File tree

Doc/libmacconsole.tex

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
\section{Built-in module \sectcode{macconsole}}
2+
\bimodindex{macconsole}
3+
4+
This module is available on the Macintosh, provided Python has been
5+
built using the Think C compiler. It provides an interface to the
6+
Think console package, with which basic text windows can be created.
7+
8+
\begin{datadesc}{options}
9+
An object allowing you to set various options when creating windows,
10+
see below.
11+
\end{datadesc}
12+
13+
\begin{datadesc}{C_ECHO}
14+
\dataline{C_NOECHO}
15+
\dataline{C_CBREAK}
16+
\dataline{C_RAW}
17+
Options for the \code{setmode} method. \var{C_ECHO} and \var{C_CBREAK}
18+
enable character echo, the other two disable it, \var{C_ECHO} and
19+
\var{C_NOECHO} enable line-oriented input (erase/kill processing,
20+
etc).
21+
\end{datadesc}
22+
23+
\begin{funcdesc}{copen}{}
24+
Open a new console window. Returns a console window object.
25+
\end{funcdesc}
26+
27+
\begin{funcdesc}{fopen}{fp}
28+
Return the console window object corresponding with the given file
29+
object. \var{Fp} should be one of \var{sys.stdin}, \var{sys.stdout} or
30+
\var{sys.stderr}.
31+
\end{funcdesc}
32+
33+
\subsection{macconsole options object}
34+
These options are examined when a window is created:
35+
36+
\renewcommand{\indexsubitem}{(macconsole option)}
37+
\begin{datadesc}{top}
38+
\dataline{left}
39+
The origin of the window.
40+
\end{datadesc}
41+
42+
\begin{datadesc}{nrows}
43+
\dataline{ncols}
44+
The size of the window.
45+
\end{datadesc}
46+
47+
\begin{datadesc}{txFont}
48+
\dataline{txSize}
49+
\dataline{txStyle}
50+
The font, fontsize and fontstyle to be used in the window.
51+
\end{datadesc}
52+
53+
\begin{datadesc}{title}
54+
The title of the window.
55+
\end{datadesc}
56+
57+
\begin{datadesc}{pause_atexit}
58+
If set non-zero, the window will wait for user action before closing
59+
the window.
60+
\end{datadesc}
61+
62+
\subsection{console window object}
63+
64+
\renewcommand{\indexsubitem}{(console window method)}
65+
66+
\begin{datadesc}{file}
67+
The file object corresponding to this console window. If the file is
68+
buffered, you should call \code{file.flush()} between \code{write()}
69+
and \code{read()} calls.
70+
\end{datadesc}
71+
72+
\begin{funcdesc}{setmode}{mode}
73+
Set the input mode of the console to \var{C_ECHO}, etc.
74+
\end{funcdesc}
75+
76+
\begin{funcdesc}{settabs}{n}
77+
Set the tabsize to \var{n} spaces.
78+
\end{funcdesc}
79+
80+
\begin{funcdesc}{cleos}{}
81+
Clear to end-of-screen.
82+
\end{funcdesc}
83+
84+
\begin{funcdesc}{cleol}{}
85+
Clear to end-of-line.
86+
\end{funcdesc}
87+
88+
\begin{funcdesc}{inverse}{onoff}
89+
Enable inverse-video mode: characters with the high bit set are
90+
displayed in inverse video (this disables the upper half of a
91+
non-ascii character set).
92+
\end{funcdesc}
93+
94+
\begin{funcdesc}{gotoxy}{x\, y}
95+
Set the cursor to position \code{(x, y)}.
96+
\end{funcdesc}
97+
98+
\begin{funcdesc}{hide}{}
99+
Hide the window, remembering the contents.
100+
\end{funcdesc}
101+
102+
\begin{funcdesc}{show}{}
103+
Show the window again.
104+
\end{funcdesc}
105+
106+
\begin{funcdesc}{echo2printer}{}
107+
Copy everything written to the window to the printer as well.
108+
\end{funcdesc}

Doc/libmacfs.tex

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
\section{Built-in module \sectcode{macfs}}
2+
\bimodindex{macfs}
3+
4+
This module provides access to macintosh FSSpec handling, the Alias
5+
Manager, finder aliases and the Standard File package.
6+
7+
Whenever a function or method expects a \var{file} argument, this
8+
argument can be one of three things: (1) a full or partial macintosh
9+
pathname, (2) an FSSpec object or (3) a 3-tuple \code{(wdRefNum,
10+
parID, name)} as described in Inside Mac VI. A description of aliases
11+
and the standard file package can also be found there.
12+
13+
\begin{funcdesc}{FSSpec}{file}
14+
Create an FSSpec object for the specified file.
15+
\end{funcdesc}
16+
17+
\begin{funcdesc}{RawFSSpec}{data}
18+
Create an FSSpec object given the raw data for the C structure for the
19+
FSSpec.
20+
\end{funcdesc}
21+
22+
\begin{funcdesc}{RawAlias}{data}
23+
Create an Alias object given the raw data for the alias.
24+
\end{funcdesc}
25+
26+
\begin{funcdesc}{ResolveAliasFile}{file}
27+
Resolve an alias file. Returns a 3-tuple \code{(fsspec, isfolder,
28+
aliased)} where \var{fsspec} is the resulting FSSpec object,
29+
\var{isfolder} is true if \var{fsspec} points to a folder and
30+
\var{aliased} is true if the file was an alias in the first place
31+
(otherwise the FSSpec object for the file itself is returned).
32+
\end{funcdesc}
33+
34+
\begin{funcdesc}{StandardGetFile}{\optional{type\, ...}}
35+
Present the user with a standard ``open onput file''
36+
dialog. Optionally, you can pass up to four 4-char file types to limit
37+
the files the user can choose from. The function returns an FSSpec
38+
object and a flag indicating that the user completed the dialog
39+
without cancelling.
40+
\end{funcdesc}
41+
42+
\begin{funcdesc}{StandardPutFile}{prompt\, \optional{default}}
43+
Present the user with a standard ``open output file''
44+
dialog. \var{prompt} is the prompt string, and the optional
45+
\var{default} argument initialized the output file name. The function
46+
returns an FSSpec object and a flag indicating that the user completed
47+
the dialog without cancelling.
48+
\end{funcdesc}
49+
50+
\begin{funcdesc}{GetDirectory}{}
51+
Present the user with a non-standard ``select a directory''
52+
dialog. Returns an FSSpec object and a success-indicator.
53+
\end{funcdesc}
54+
55+
\subsection{FSSpec objects}
56+
57+
\renewcommand{\indexsubitem}{(FSSpec object method)}
58+
\begin{datadesc}{data}
59+
The raw data from the FSSpec object, suitable for passing
60+
to other applications, for instance.
61+
\end{datadesc}
62+
63+
\begin{funcdesc}{as_pathname}{}
64+
Return the full pathname of the file described by the FSSpec object.
65+
\end{funcdesc}
66+
67+
\begin{funcdesc}{as_tuple}{}
68+
Return the \code{(wdRefNum, parID, name)} tuple of the file described
69+
by the FSSpec object.
70+
\end{funcdesc}
71+
72+
\begin{funcdesc}{NewAlias}{\optional{file}}
73+
Create an Alias object pointing to the file described by this
74+
FSSpec. If the optional \code{file} parameter is present the alias
75+
will be relative to that file, otherwise it will be absolute.
76+
\end{funcdesc}
77+
78+
\begin{funcdesc}{NewAliasMinimal}{}
79+
Create a minimal alias pointing to this file.
80+
\end{funcdesc}
81+
82+
\begin{funcdesc}{GetCreatorType}{}
83+
Return the 4-char creator and type of the file.
84+
\end{funcdesc}
85+
86+
\begin{funcdesc}{SetCreatorType}{creator\, type}
87+
Set the 4-char creator and type of the file.
88+
\end{funcdesc}
89+
90+
\subsection{alias objects}
91+
92+
\renewcommand{\indexsubitem}{(alias object method)}
93+
\begin{datadesc}{data}
94+
The raw data for the Alias record, suitable for storing in a resource
95+
or transmitting to other programs.
96+
\end{datadesc}
97+
98+
\begin{funcdesc}{Resolve}{\optional{file}}
99+
Resolve the alias. If the alias was created as a relative alias you
100+
should pass the file relative to which it is. Returns the FSSpec for
101+
the file pointed to and a flag indicating whether the alias object
102+
itself was modified during the search process.
103+
\end{funcdesc}
104+
105+
\begin{funcdesc}{GetInfo}{num}
106+
An interface to the C routine \code{GetAliasInfo()}.
107+
\end{funcdesc}
108+
109+
\begin{funcdesc}{Update}{file\, \optional{file2}}
110+
Update the alias to point to the \var{file} given. If \var{file2} is
111+
present a relative alias will be created.
112+
\end{funcdesc}
113+
114+
Note that is currently not possible to directly manipulate a resource
115+
as an alias object. Hence, after calling \var{Update} or after
116+
\var{Resolve} indicates that the alias has changed the python program
117+
is responsible for getting the \var{data} from the alias object and
118+
modifying the resource.
119+
120+

Doc/libmacspeech.tex

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
\section{Built-in module \sectcode{macspeech}}
2+
\bimodindex{macspeech}
3+
4+
This module provides an interface to the Macintosh Speech Manager,
5+
allowing you to let the macintosh utter phrases. You need a version of
6+
the speech manager extension (version 1 and 2 have been tested) in
7+
your \code{Extensions} folder for this to work. The module does not
8+
provide full access to all features of the Speech Manager yet.
9+
10+
\begin{funcdesc}{Available}{}
11+
Test availability of the Speech Manager extension (and, on the
12+
PowerPC, the Speech Manager shared library). Returns 0 or 1.
13+
\end{funcdesc}
14+
15+
\begin{funcdesc}{Version}{}
16+
Return the (integer) version of the Speech Manager.
17+
\end{funcdesc}
18+
19+
\begin{funcdesc}{SpeakString}{str}
20+
Utter the string \var{str} using the default voice,
21+
asynchronously. This aborts any speech that may still be active from
22+
prior \code{SpeakString} invocations.
23+
\end{funcdesc}
24+
25+
\begin{funcdesc}{Busy}{}
26+
Return the number of speech channels busy, system-wide.
27+
\end{funcdesc}
28+
29+
\begin{funcdesc}{CountVoices}{}
30+
Return the number of different voices available.
31+
\end{funcdesc}
32+
33+
\begin{funcdesc}{GetIndVoice}{num}
34+
Return a voice object for voice number \var{num}.
35+
\end{funcdesc}
36+
37+
\subsection{voice objects}
38+
Voice objects contain the description of a voice. It is currently not
39+
yet possible to access the parameters of a voice.
40+
41+
\renewcommand{\indexsubitem}{(voice object method)}
42+
43+
\begin{funcdesc}{GetGender}{}
44+
Return the gender of the voice: 0 for male, 1 for female and -1 for neuter.
45+
\end{funcdesc}
46+
47+
\begin{funcdesc}{NewChannel}{}
48+
Return a new speech channel object using this voice.
49+
\end{funcdesc}
50+
51+
\subsection{speech channel objects}
52+
A speech channel object allows you to speak strings with slightly more
53+
control than \code{SpeakString()}, and allows you to use multiple
54+
speakers at the same time. Please note that channel pitch and rate are
55+
interrelated in some way, so that to make your macintosh sing you will
56+
have to adjust both.
57+
58+
\renewcommand{\indexsubitem}{(speech channel object method)}
59+
\begin{funcdesc}{SpeakText}{str}
60+
Start uttering the given string.
61+
\end{funcdesc}
62+
63+
\begin{funcdesc}{Stop}{}
64+
Stop babbling.
65+
\end{funcdesc}
66+
67+
\begin{funcdesc}{GetPitch}{}
68+
Returns the current pitch of the channel, as a floating-point number.
69+
\end{funcdesc}
70+
71+
\begin{funcdesc}{SetPitch}{pitch}
72+
Set the pitch of the channel.
73+
\end{funcdesc}
74+
75+
\begin{funcdesc}{GetRate}{}
76+
Get the speech rate (utterances per minute) of the channel as a
77+
floating point number.
78+
\end{funcdesc}
79+
80+
\begin{funcdesc}{SetRate}{rate}
81+
Set the speech rate of the channel.
82+
\end{funcdesc}
83+

0 commit comments

Comments
 (0)