]> code.delx.au - gnu-emacs/blob - nextstep/README
Update NextStep readme and add wish list.
[gnu-emacs] / nextstep / README
1
2 NS -- the Cocoa interface for OS X and compatible systems
3 ---------------------------------------------------------
4
5 This directory contains files needed to build Emacs on system based on
6 NextStep (NS), including OS X (Mac) and GNUstep, using the Cocoa API.
7
8
9 HISTORY
10
11 Up to Emacs 22, the OS X interface was implemented using the C-based
12 Carbon API. Starting with Emacs 23, the interface was rewritten in
13 Objective-C using the Cocoa API. Meanwhile, the Carbon interface has
14 been maintained independently under the name "mac".
15
16
17 OVERVIEW OF COCOA AND OBJECTIVE-C
18
19 Cocoa is an API for the Objective-C language, an objective oriented
20 superset of C. Anybody with experience with iOS or modern OS X
21 application development should feel at home.
22
23 A method call in Objective-C differs from most other languages in the
24 fact that it doesn't have a normal name. Instead, the method name is
25 made up of the name of each parameter. An exception to this rule are
26 methods without parameters.
27
28 The following calls a method in the object `anObject'.
29
30 [anObject alpha:1 beta:2 gamma:3];
31
32 Classes are declared like the following:
33
34 @interface AClassName
35 {
36 // A class method.
37 + (TYPE)name1:(TYPE)param1
38
39 // An object method.
40 - (TYPE)name1:(TYPE)param1 name2:(TYPE)param2;
41 }
42 @end
43
44
45 GUIDELINES
46
47 * Adhere the to the FSF philosophy that a feature in GNU software
48 should not only be available on non-free systems.
49
50 * People with varying Cocoa and Objective-C skills will read and
51 modify the NS code over a long period of time. Keep the code simple
52 and avoid language constructs that makes the code hard to maintain.
53
54 * Don't use macros and types intended for the XCode Interface Builder,
55 like `IBAction'.
56
57 * The NS interface should work on all version of OS X from 10.6.8
58 (Snow Leopard) to the latest official release.
59
60 * Under OS X, it is possible to build Emacs using NS, X11, or console
61 only. A new OS X feature should work in all appropriate builds.
62
63
64 TRACING SUPPORT
65
66 The NS interface features a printf-based trace package that prints the
67 call tree of selected functions in the Cocoa interface, plus various
68 extra information. It can be enabled by uncommenting the line
69 defining `NSTRACE_ENABLED' in "nsterm.h". To enable more output,
70 uncomment the lines defining symbols starting with `NSTRACE_GROUP'.
71
72
73 GNUSTEP AND OTHER COMPATIBLE SYSTEMS
74
75 The NS interface works on system compatible with OS X, for example
76 GNUstep. Even though they are less frequently used, this is important
77 for a number of reasons:
78
79 * It supports the GNUstep project and provides an Emacs with the same
80 look-and-feel as the rest of the system.
81
82 * This allows other Emacs developers to test their changes on the NS
83 interface without having access to an OS X machine.
84
85 * If a feature in the NS interface work on free systems like GNUstep,
86 this meets the FSF requirement that features in GNU software should
87 not only be available on non-free systems.
88
89
90 SEE ALSO
91
92 The src/ns... files contains the C and Objective-C parts.
93
94 The lisp/term/ns-win.el file contains the lisp part of the NS
95 interface.
96
97 The INSTALL file in this directory for compilation instructions.
98
99 The WISHLIST file in this directory for a list of ideas for future
100 development of the NS interface.