Aparajita Fishman afd5925499 Fixed: _CG and _CP macros were confusing and could degrade performance
Previously, Cappuccino was using preprocessor macros internally for the CGPoint/Size/Rect/Inset/Affine functions, as well as for CPRange. These macros had the same name as the corresponding function, but began with _. The functions were actually defined using the macros.

The motivation behind using macros was to increase performance by reducing function calls. However, there were a number of problems with this approach:

- There was an artificial dichotomy between _CG macros and the corresponding CG functions. We never completely replaced CG function calls with _CG macros. In fact, they were often mixed up in the same file. There was an extra burden on the programmer to remember to use the macro instead of the function.
- If a method call was passed as an argument to a macro, performance could actually be significantly *worse* than a function call. For example, _CGGetRectMakeCopy([view frame]) would expand to `{ origin:{ x:[view frame].origin.x, y:[view frame].origin.y }, size:{ width:[view frame].size.width, height:[view frame].size.height } }`. So instead of a single objj_msgSend and a single simple function call, we ended up with 4 objj_msgSend calls, which are way more expensive than simple function calls.
- Because of this expansion problem, to use macros efficiently required us to remember to use variables for all macro parameters. This didn't happen, and shouldn't have to happen.
- Finally, with modern Javascript engines, function call overhead is so small that it really isn't worth using the macros.

This commit eliminates the _CGGeometry, CGAffineTransformation and CPRange macros and replaces them with function calls.

BREAKING CHANGE:
The macros are no longer available. They could only be used with compiled code, but if there is any user code that used them, they will have to be replaced with the corresponding functions.
2013-03-13 12:22:10 -04:00
2013-01-08 15:03:14 -08:00
2013-03-12 13:40:18 -03:00
2013-01-19 02:27:43 +00:00
2008-09-04 03:52:20 -07:00
2009-12-19 04:31:11 -08:00

Welcome to Cappuccino!

Introduction

Cappuccino is an open source framework that makes it easy to build desktop-caliber applications that run in a web browser.

Cappuccino is built on top of standard web technologies like JavaScript, and it implements most of the familiar APIs from GNUstep and Apple's Cocoa frameworks. When you program in Cappuccino, you don't need to concern yourself with the complexities of traditional web technologies like HTML, CSS, or even the DOM. The unpleasantries of building complex cross browser applications are abstracted away for you.

For more information, see http://cappuccino-project.org.

System Requirements

To run Cappuccino applications, all you need is a web browser that understands JavaScript.

To build Cappuccino itself, please read below. More information is available here: Getting and Building the Source.

If you're using Windows, you'll also need Cygwin.

Finally, if you want to easily stay up to date with the latest developments and contribute your work back to the Cappuccino community, you'll want to install Git.

Getting Started

To get started, download and install the current release version of Cappuccino:

$ curl https://raw.github.com/cappuccino/cappuccino/v0.9.7-alpha1/bootstrap.sh >/tmp/cappuccino_bootstrap.sh && bash /tmp/cappuccino_bootstrap.sh

If you'd just like to get started using Cappuccino for your web apps, you are done.

The rest of these instructions are for building a development copy of Cappuccino. To build Cappuccino from source, check out the most recent stable version from GitHub:

$ git clone git://github.com/cappuccino/cappuccino.git (git)

or download the zipball of the most recent source code:

http://github.com/cappuccino/cappuccino/zipball/master (zip)

Then, simply type jake from within the root of the Cappuccino directory. If you get an error like jake: command not found, you forgot to run the bootstrap script as described above.

Jake will build a "release" copy of the frameworks. Typing jake debug will build a debug version.

jake install will build Cappuccino and associated tools and install them for general use.

Editors

The Cappuccino TextMate Bundle: http://github.com/malkomalko/Cappuccino.tmbundle.

The Cappuccino Xcode Plugin: http://github.com/rbartolome/xcode-cappuccino.

Getting Help

If you need help with Cappuccino, you can get help from the following sources:

If you discover any bugs, please file a ticket at:

http://github.com/cappuccino/cappuccino/issues

License

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

S
Description
No description provided
Readme LGPL-2.1
106 MiB
0 Stars 1 Watchers 0 Forks
Languages
Objective-J 66.1%
HTML 19.6%
JavaScript 10.5%
Objective-C 1.8%
Python 1%
Other 0.8%