|Revision as of 16:01, 17 November 2010
Bheron (Talk | contribs)
What is Cocoa?
← Previous diff
|Revision as of 16:02, 17 November 2010
Bheron (Talk | contribs)
What is GNUstep?
Next diff →
|Line 3:||Line 3:|
|=== What is GNUstep? ===||=== What is GNUstep? ===|
|-||GNUstep is the Free Software Foundation's effort to implement Apple, Inc's (formerly NeXT Software, Inc.'s) Cocoa APIs (formerly the [[OpenStep]] Standard). Also we are building developer and user applications based on this standard which may be used to form a complete desktop experience. For more details, take a look at the [[Introduction to GNUstep|introduction]].||+||GNUstep is the Free Software Foundation's effort to implement Apple, Inc's (formerly NeXT Software, Inc.'s) [[Cocoa]] APIs (formerly the [[OpenStep]] Standard). Also we are building developer and user applications based on this standard which may be used to form a complete desktop experience. For more details, take a look at the [[Introduction to GNUstep|introduction]].|
|=== What is Cocoa? ===||=== What is Cocoa? ===|
Revision as of 16:02, 17 November 2010
GNUstep General Information
What is GNUstep?
GNUstep is the Free Software Foundation's effort to implement Apple, Inc's (formerly NeXT Software, Inc.'s) Cocoa APIs (formerly the OpenStep Standard). Also we are building developer and user applications based on this standard which may be used to form a complete desktop experience. For more details, take a look at the introduction.
What is Cocoa?
Cocoa is an Application Programming Interface (API) for creating applications using the Objective-C language. It was published by Apple, Inc.(Formerly NeXT Software, Inc.).
Cocoa consists of three parts: the `Foundation Kit', a library of non-graphical objects; the `Application Kit', a library of objects useful in creating graphical applications; and the Quartz display system.
What platforms does GNUstep run on?
See the list of supported platforms for information on what machines GNUstep builds on and what the status of the ports is. Probably a few days porting to any other UNIX system where current gcc compilers and gdb debugger work.
Does GNUstep run on Windows?
The primary targets for GNUstep are free UNIX system-based platforms such as GNU/Linux and FreeBSD.
That being said, the whole environment has been ported to MinGW environment and the non-gui libraries are reported to work well.
The GUI library uses the win32 backend library to work under Windows. The backend library is a thin layer that converts the GNUstep methods to handle drawing of GUI elements to calls to the Windows API. This project is currently in beta.
What is GNUstep's position towards KDE and the GNOME project?
You can use GNUstep with GNOME and/or KDE. GNUstep displays on top of X11. You can still do programming in C (since Objective-C is just a super-set of C), and if you're using gcc 4.1 or later, you can mix C++ and Objective-C code in the same file.
GNUstep, is much more than a window manager or desktop environment. It frees you to develop cross-platform applications without the work of developing an OS independent framework from scratch. It gives you lots of basic functionality, from font panels to Unicode strings to distributed objects.
How can I get GNUstep?
Many distributions include packaged versions of GNUstep (Debian, etc.). To compile from scratch, download the GNUstep Startup package or take a look at the Platform compatibility list. Get the latest releases from FTP.
How do you run GNUstep?
You are presumably under the misapprehension that GNUstep is some sort of program or window manager. It isn't! GNUstep is a whole load of things -- primarily a set of libraries for developing software. At present, it's those libraries, plus various command-line based support tools and service providing daemons, plus various GUI development tools, a GUI desktop/workspace application, etc. At no stage will you ever 'run' GNUstep -- you will run applications and tools and will make use of it's services. At some point you may well find packages distributed as 'GNUstep' systems in the way that you get 'GNU/Linux' systems packaged today. For instance, look at the GNUstep Live CD.
If you want to see a sample GUI application running you need to build GNUstep and look at the example applications in the gnustep-examples package. Build 'Finger' or 'Ink' and start it with 'openapp Finger.app' or 'openapp Ink.app'
For the best look, use WindowMaker (preferred GNUstep window manager) as your window manager.
Is there a web site?
When is GNUstep intended to be available?
It's usable now. Major releases are made about every six months. However, if you are a serious developer, it's probably best to use the latest snapshots.
What is usable?
Most of GNUstep is quite usable and there are many complex applications that work well. However, GNUstep does not completely track the latest changes that Apple makes to their interface and there are still some parts that need some work). This means many applications will run quite well. Applications that require very complex text handling and some unusual features and/or some of the latest additions to Cocoa may not work as well.
Compiling and Installing
How do I compile GNUstep on my machine?
Read the file 'GNUstep-HOWTO', which comes with the GNUstep distribution (gnustep-make), and also is available separately on the GNUstep web site. To check beforehand, take a look at the Platform compatibility list.
Are there any precompiled packages available?
Check the Download Section for links to RPMs, Debian packages, and BSD ports. There are also Windows installers, Mac OS X binaries and others.
How do I start the applications I just installed?
First, read http://www.gnustep.org/resources/documentation/User/GNUstep/gnustep-howto_4.html#SEC7 to make sure you have set up your environment correctly. Then from a terminal enter:
What are these type and size warnings?
/usr/bin/ld: warning: type and size of dynamic symbol `__objc_class_name_NSConstantString' are not defined
are a common occurence and are due to a mismatch between the gcc compiler and the ld linker. They don't do any harm so they can be safely ignored. They have been fixed in the 3.1 version of the GCC compiler.
What are these import warnings?
Do you get this obnoxious warning whenever you compile an application, tool, or Objective-C program:
warning: using `#import' is not recommended [...]
Up until version 3.4 of the GCC compiler, the #import directive was improperly implemented. As a result, the compiler automatically emitted a warning whenever the #import directive was used. As of gcc 3.4, this problem has been fixed, so presumably, this warning is no longer emitted when code is compiled. If you are using an earlier compiler, you can suppress these warnings by adding -Wno-import to your include (cpp) flags.
Compatibility and Layout
Can I run NeXT OPENSTEP or Mac OS X programs on GNUstep?
You can't run these programs on GNUstep, but if you have the source code for the programs, you should be able to port them to GNUstep and compile them. Whether or not you will be able to run them depends on how complete GNUstep is at the time.
Is GNUstep following changes to OpenStep and Mac OS X?
Yes, gnustep-base already contains the documented changes in the Foundation library. GNUstep aims to be compatible with both the OpenStep specification and with Mac OS X. It should be easy to write an application that compiles cleanly under both GNUstep and Cocoa.
Do we have to have the NEXTSTEP look and feel?
GNUstep is aiming for something like the NEXTSTEP 3.3 look and feel. Although we don't want to force anyone into this, a lot of the power and ease of use comes from this feel. The look of GNUstep is something different -- buttons and other widgets can look different but still act the same way. We hope to implement themes which will allow this.
For a different desktop feel please see Themability.
What's up with the directory structure?
First of all, GNUstep uses a slightly different directory structure than NEXTSTEP or Mac OS X. Part of this is historical, part is because we can't do things the same way (see the section User FAQ#Why not use framework bundles?). Although currently the structure is very similar to the one used in Mac OS X.
It's also possible to configure GNUstep run using the standard FHS directory structured used under GNU/Linux and other unices so that it blends better in the host environment.
Why not use framework bundles?
Framework bundles are much more difficult to port and to use, and are very unnatural on a UNIX system; extremely unnatural on Windows. In a framework bundle, the shared dynamic library is inside a framework wrapper directory. Because of this, the dynamic linker can't find it.
We have frameworks, so how do we work around that? Well, we build dynamic links from a directory inside the dynamic linker path into the framework, which work, but then you can't move the framework anywhere else on the system, otherwise you break the link, and nothing will find the framework any longer! On systems without dynamic links, like Windows, we can't even do this! We have to copy the library from the framework into the dynamic linker path, but that is simply a shared library then! Absolutely no difference. You put the dynamic library in a system directory in the dynamic linker path, and associate with that library a resource directory. OpenStep for Windows did that, and still called them frameworks. So we can do the same, and call our libraries frameworks.
Shared libraries are all in a flat directory where the dynamic linker can easily find them. This is how it works on Unixoids, Windows and probably most other systems. The OpenStep API requires us to provide some stuff for frameworks, like creating and registering a framework object automatically each time a framework is used (linked at runtime, or linked into the app), and attaching to it the list of classes inside the framework, which are not particularly trivial to implement and might make trouble when porting, as they depend on playing with the linker and the object file format. However, shared libraries are handled by the operating system for us, so we never have to use these facilities.
It's easier for Apple's Mac OS X. They can modify the system linker, compiler, the system dynamical linker as they please, because they have full control over the platform these run on. They can modify the system to support frameworks natively. GNUstep, however, is meant to run on many different platforms, platforms which we don't control (Windows, Sun Solaris, Darwin, GNU/Linux, UNIX system variants) and which have different linkers and do not support frameworks natively. On some systems it's difficult to just load a bundle or compile a shared library!
So building the core libraries as 'libraries' means that it's much easier to port them, and it's much more difficult to break them. Sure, frameworks have a bundle of resources associated with it -- but we can very easily associate a bundle of resource with a shared library, no reason why not. We are doing it. So please note that GNUstep libraries are meant to be much similar to Mac OS X frameworks. They are composed of a shared library and associated with a bundle of resources. There is a difference in terminology, in where the resources are installed, and possibly a slight difference in the NSBundle API to get to the resource bundle (anyway, it's a one line difference between Mac OS X and GNUstep, so it looks like very easy to #ifdef).
In other words, GNUstep libraries are meant to basically do the same as frameworks do on Mac OS X, but to be portable to very different platforms (such as Windows).
Why not use native widgets?
The GNUstep GUI code is divided into two libraries ... the gui proper (gnustep-gui), which handles most of the work of implementing the AppKit API, and the backend (gnustep-back) which handles the interface to the native operating system. The display server (GSDisplayServer) is one of the two classes which provide the main interface between the two parts. The other class is the graphics context (NSGraphicsContext). The later does the actual drawing whereas the former manages windows and events. This separation is just great to have multiple graphics backends like art, xlib and cairo share the same x11 display server. So code in gnustep-gui calls methods of the display server, and code in gnustep-back translates those calls to native calls of the system you are running on.
This means that application developers use the OpenStep/GNUstep/MacOS-X AppKit API to write their applications, and the gnustep-back library uses the native functionality to do the job where possible. For instance, you do cut and paste or DnD using the OpenStep API for that, and on an ms-windows system, the actual calls to perform the operations are the native win32 ones. ie we leave the job to the operating system, so cut and paste from gnustep applications can interact with cut and paste from native win32 applications. Of course, where the two APIs (OpenStep and win32) operate in very different ways, the conversion between the two is hard, but often the layer between the two is quite thin.
One area where there is not much scope for overlap is drawing within a window ... the way that the OpenStep API operates is so different from ms-widnows or X-windows that high level code for drawing things inside a windows using the native operating system generally cannot fit with OpenStep, so the gui library does all the drawing inside the window with quite low level code rather than trying to map OpenStep 'controls' to native 'widgets'.
Since the basic design of the two (frontend and backend) libraries is, to draw OpenStep controls rather than try to map to native controls (because that's generally easier and makes the code very portable), we generally make no use of native widgets. However, the gui frontend can dynamically load a theme engine to draw it's controls, and a theme engine is free to try to draw parts of a window using its own code ... so it can use the native controls where that's a practical solution.
Problems compiling (loading shared libs)
If you get something like
plmerge: error while loading shared libraries: libgnustep-base.so.1: cannot open shared object file: No such file or directory
Making all for service example... make: *** [example.service/Resources/Info-gnustep.plist] Error 1 make: *** [example.all.service.variables] Error 2 make: Leaving directory `/home/multix/gnustep-gui-0.8.6/Tools' make: *** [internal-all] Error 2
This means your GNU make is being overly protective. When you try to become root (e.g. to install something), certain environment variables like LD_LIBRARY_PATH are unset in order to reduce the possibility of a security breach. If you are becoming root to install something, you need to exec the GNUstep.sh file as root, just as you do when you login. Although for simplicity, you can also try this:
You could also be having problems with gcc. gcc 2.96 does not work (Mandrake 8.1, perhaps others). Use a different compiler, like gcc 3.x.
Problems compiling (GNUstep Internal Error)
If you get
GNUSTEP Internal Error: The private GNUstep function to establish the argv and environment variables was not called. Please report the error to firstname.lastname@example.org.
when compiling the gui library, there could be several things wrong. One is that you installed the gnustep-objc library, but the compiler found another Objecive-C library (like the one that came with gcc). If you are using gcc 3.x, DO NOT use the gnustep-objc library.
There could also be a mismatch between the base and gui library versions. Make sure you have the latest release of each library installed.
Problems with Alt key
It's possible the Alt key is not where you think it is or is defined incorrectly. Try running the GSTest application, KeyboardInput test (located in the examples package at FTP) to test it. See keyboard setup for information on how to change the settings.
If you are using WindowMaker, it's possible it is grabing this key and using it for itself. To check, open Window Maker's WPrefs and go to the Mouse Preferences. Then use another value for the "Mouse grab modifier" (bottom right). That will allow you to alt-drag things.
Problems with gcc3
Don't forget you need to update binutils and libc also.
Problems with fonts
Why do the characters get changed to asterisks ('*')?
The problem you are getting come from the fact that the xlib backend (when not using Xft) will only use one fixed X font for a given font name. If the font "helvetica" is used inside of GNUstep the one selected X font, in your case "-*-helvetica-medium-r-normal--12-*-*-*-p-*-iso8859-1" is used. So only characters (or glyphs) that are available in that font can be displayed. The selection of which font name to use happens inside the font_cacher and is more or less at random (the order fonts are listed by the X system).
You can influence the fonts that are available by setting:
defaults write NSGlobalDomain GSFontMask "*iso8859-13" font_cacher
(or using a different character set, like iso8859-2). This is really a bug in GNUstep, but it hasn't been fixed yet.
The other option is the use the art backend, which handles fonts much better. When compiling gnustep-back, start with
No characters displayed
When using the xlib backend, no characters are displayed in any GNUstep applications.
The xlib backend has font anti-aliasing turned on by default. It's possible that GNUstep can't find any fonts on your system that can be properly anti- aliased. Try
defaults write NSGlobalDomain GSFontAntiAlias NO
to turn off font anti-aliasing.
I tried to compile something and I get:
GNUmakefile:27: /Makefiles/common.make: No such file or directory GNUmakefile:39: /Makefiles/aggregate.make: No such file or directory gmake: *** No rule to make target `/Makefiles/aggregate.make'. Stop.
Make sure you have installed the gnustep-make package and also type something like
depending on your GNUstep's installation path.
You can put this line in your `.profile' or `.bash_profile' file so that it is done automatically when you log in.
Why don't you just have Gorm output Renaissance files?
Philosophical and architectural incompatibilities.
Is there a way to install GNUstep on Mac OS X?
Yes! Please see MacOS X installation notes.
Is there any way to use gnustep-make and gnustep-base without using openapp/opentool?
opentool is obsolete and you should be able to run command-line programs directly from your shell prompt like any other command-line program.
openapp is useful to run applications but in standard situations you can also run directly the program from within the .app folder.
Can GNUstep help with porting applications from MacOS-X? Is there any HOWTO on that?
See for example Tamsys.
How difficult it should be to port it to Linux and GNUstep?
Somehow relevant may be discussion on How to port to GNUstep Answered. Unfortunately this link is broken now. Dredge around in the google discussion group, I guess. I couldn't find anything helpful.
Can I deploy my GNUstep application without requiring people to install GNUstep?
No. Compare it to running Java applications without people requiring to install Java runtime environment.
How can I get more information on Objective-C ?
Take a look at the Objective-C page.