]> code.delx.au - gnu-emacs/blob - nextstep/README
* src/macfont.m (mac_font_shape): Make sure that total_advance is increasing.
[gnu-emacs] / nextstep / README
1 NS -- the Cocoa interface for OS X and compatible systems
2 ---------------------------------------------------------
3
4 This directory contains files needed to build Emacs on system based on
5 NextStep (NS), including OS X (Mac) and GNUstep, using the Cocoa API.
6
7
8 HISTORY
9
10
11 The Nextstep (NS) interface of GNU Emacs was originally written in
12 1994 for NeXTSTEP systems running Emacs 19 and subsequently ported to
13 OpenStep and then Rhapsody, which became Mac OS X. In 2004 it was
14 adapted to GNUstep, a free OpenStep implementation, and in 2008 it was
15 merged to the GNU Emacs trunk and released with Emacs 23. Around the
16 same time a separate Mac-only port using the Carbon APIs and
17 descending from a 2001 MacOS 8/9 port of Emacs 21 was removed. (It
18 remains available externally under the name "mac".)
19
20
21 OVERVIEW OF COCOA AND OBJECTIVE-C
22
23 Cocoa is an API for the Objective-C language, an objective oriented
24 superset of C. Anybody with experience with iOS or modern OS X
25 application development should feel at home.
26
27 A method call in Objective-C differs from most other languages in the
28 fact that it doesn't have a normal name. Instead, the method name is
29 made up of the name of each parameter. An exception to this rule are
30 methods without parameters.
31
32 The following calls a method in the object 'anObject'.
33
34 [anObject alpha:1 beta:2 gamma:3];
35
36 Classes are declared like the following:
37
38 @interface AClassName
39 {
40 // A class method.
41 + (TYPE)name1:(TYPE)param1
42
43 // An object method.
44 - (TYPE)name1:(TYPE)param1 name2:(TYPE)param2;
45 }
46 @end
47
48
49 GUIDELINES
50
51 * Adhere the to the FSF philosophy that a feature in GNU software
52 should not only be available on non-free systems.
53
54 * People with varying Cocoa and Objective-C skills will read and
55 modify the NS code over a long period of time. Keep the code simple
56 and avoid language constructs that makes the code hard to maintain.
57
58 * Don't use macros and types intended for the XCode Interface Builder,
59 like 'IBAction'.
60
61 * The NS interface should work on all version of OS X from 10.6.8
62 (Snow Leopard) to the latest official release.
63
64 * Under OS X, it is possible to build Emacs using NS, X11, or console
65 only. A new OS X feature should work in all appropriate builds.
66
67
68 TRACING SUPPORT
69
70 The NS interface features a printf-based trace package that prints the
71 call tree of selected functions in the Cocoa interface, plus various
72 extra information. It can be enabled by uncommenting the line
73 defining 'NSTRACE_ENABLED' in "nsterm.h". To enable more output,
74 uncomment the lines defining symbols starting with 'NSTRACE_GROUP'.
75
76
77 GNUSTEP AND OTHER COMPATIBLE SYSTEMS
78
79 The NS interface works on system compatible with OS X, for example
80 GNUstep. Even though they are less frequently used, this is important
81 for a number of reasons:
82
83 * It supports the GNUstep project and provides an Emacs with the same
84 look-and-feel as the rest of the system.
85
86 * This allows other Emacs developers to test their changes on the NS
87 interface without having access to an OS X machine.
88
89 * If a feature in the NS interface work on free systems like GNUstep,
90 this meets the FSF requirement that features in GNU software should
91 not only be available on non-free systems.
92
93
94 SEE ALSO
95
96 The src/ns... files contains the C and Objective-C parts.
97
98 The lisp/term/ns-win.el file contains the lisp part of the NS
99 interface.
100
101 The INSTALL file in this directory for compilation instructions.
102
103 The Nextstep section in the etc/TODO file for a list of ideas for
104 future development.
105
106 \f
107 ----------------------------------------------------------------------
108 Copyright 2008-2016 Free Software Foundation, Inc.
109
110 This file is part of GNU Emacs.
111
112 GNU Emacs is free software: you can redistribute it and/or modify
113 it under the terms of the GNU General Public License as published by
114 the Free Software Foundation, either version 3 of the License, or
115 (at your option) any later version.
116
117 GNU Emacs is distributed in the hope that it will be useful,
118 but WITHOUT ANY WARRANTY; without even the implied warranty of
119 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
120 GNU General Public License for more details.
121
122 You should have received a copy of the GNU General Public License
123 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.