Re: NSSound
Stefan Bidigaray a écrit : I think I was unclear on how I was storing the data... On Thu, Jun 4, 2009 at 2:04 AM, Fred Kiefer fredkie...@gmx.de mailto:fredkie...@gmx.de wrote: I think that in almost all cases using NSData is better then storing a pointer. That way you only have to worry once (when creating the NSData object) about who is responsible for cleaning up afterwards. I'll go ahead and use a NSData object to store the data, but to make my life easier on the playback side I only store raw 16-bit PCM data into the object. This allows me to not have to convert it later, and is the native format for most (if not all) sound cards. 24-bits audio becomes very common. Anyway, as Fred said, the format of the data has not to be handle by NSSound : libsndfile do it fine. Just put the audio in a NSData and sndfile will convert it for you. If you use jack (do you ?), i think you only have to call sf_read_float and send the result to jack, that will convert it (again) to a format supported by the hardware. Writing in differenet formats should be no concern for NSSound, all we have to support is writing the data to the pasteboard in a format we are able to read ourselves. As for reading we should rely on NSData and have the other two init methods just create a suitable NSData object. What ever happens inside of -initWithData: is up to your. So should I leave -dataWithFormat:fileType: out? And keep the raw reading method (David seems to like the idea)? As I said, I agree with Fred : NSSound has nothing to do with audio format. And I agree with David : this method might be usefull ;) A GSSoundKit might be the right place for it. http://www.cilinder.be/docs/next/NeXTStep/3.3/nd/ http://www.musickit.org/ As I understand it you are using two different libraries, libsndfile to read the data and OpenAL to play the sound. As each of them may not be available on the user system it is great to have fallbacks for that case. I think it would be enough to support one file format, though. Well, since the data in all these format are the same, all I really have to worry about is correctly reading the headers. For example, AU can store uLaw, aLaw and 8, 16, 24 and 32 bit PCM in big endian; WAV can store uLaw, aLaw and 8, 16, 24 and 32 bit PCM in little endian. So really, once I can read WAV, I can also read AU as long as I account for the header and convert endian format. On debian lenny i386 libsndfile.so is less than 360Kio while libgnustep-gui.so is near 4Mio. If you think it is realy important, what about a reduced libsndfile ? One may probably build sndfile with a reduced set of codecs (the LGPL ones). Thanks for the input. I have a lot clearer way ahead at this point. I'll leave the back-end (gnustep_sndd, OpenAL or even JACK now) to after I have a complete, working implementation of the front-end. There are some things that need to be analyzed in some more detail there. Stefan Regards, - Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSSound
Stefan Bidigaray a écrit : On Fri, Jun 5, 2009 at 3:29 AM, Xavier Glattard xavier.glatt...@online.fr mailto:xavier.glatt...@online.fr wrote: 24-bits audio becomes very common. What i mean is that most (all?) sound cards are now 24-bits / 96kHz. Even the old Audigy can do that. (...) A GSSoundKit might be the right place for it. http://www.cilinder.be/docs/next/NeXTStep/3.3/nd/ http://www.musickit.org/ I would really like to go into something like this, I'm actually trying my best to write NSSound in a way that this can be more easily accomplished. I agree ;) That why I think you should Keep It Simple. On debian lenny i386 libsndfile.so is less than 360Kio while libgnustep-gui.so is near 4Mio. If you think it is realy important, what about a reduced libsndfile ? One may probably build sndfile with a reduced set of codecs (the LGPL ones). I mean here that a reduced libsndfile might be included in your code, that will be updated along with the official libsndfile. You would not have to write a fallback NSSound. At least on an audio-capable system. But it might be easier to write your own code - 'dunno. Did you check portaudio ? (just fall on it) It is damn' small! (44Kio) Regards, - Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSSound
David Chisnall a écrit : On 3 Jun 2009, at 13:34, Stefan Bidigaray wrote: I just wrote a really long list of stuff I dislike about having gnustep_sndd and using OpenAL instead of portaudio, but I decided not to send that. Really, I think the most compeling reason that I went with OpenAL is for how simple it is, and it's cross-platformness (that's right, new word :) ), not to mention we're just re-inventing the wheel by having our own sound server... ALSA, OSS, winmm, CoreAudio all already implement software mixing with a lot more features and optimization that gnustep_sndd. Why have our own, prone to bugs since very few people use it, when we can use the native OS's version? Couldn't agree more. Portaudio kind-of works on Linux, occasionally works on other platforms, and is a buggy mess. The only reason to have any kind of sound server is that the OS doesn't support mixing at the driver level, and so having a separate sound server per toolkit is completely pointless. At the moment, sound playback in Mélodie, which uses OSS directly, works on more of the machines I've tried it on than simple NSSounds going 'bing' and this is clearly far from ideal. OpenAL is well-supported and is a relatively simple API. It's a far better choice than PortAudio. Ideally, we should have an interface in -back that used the host platform's native APIs (OSS, ALSA, DirectShow, CoreAudio, etc) directly, but doing this is a massive amount of work for very little gain. Just an idea : http://jackaudio.org/ Regards, - Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSSound
Stefan Bidigaray a écrit : On Wed, Jun 3, 2009 at 9:17 AM, Xavier Glattard xavier.glatt...@online.fr mailto:xavier.glatt...@online.fr wrote: Just an idea : http://jackaudio.org/ Before settling on OpenAL I took a look at all the popular sound servers out there (even thought about using PulseAudio). I can't really remember why I didn't pick it, but I'll look at it again. I did a quick walk through the API and couldn't see anything that jumped at me as to why OpenAL and not JACK. Stefan I just have a quick look on OpenAL: it's is a powerful API, dedicated to 3D audio and gaming. The project is mostly supported by Creative. Jack API is quite simple: it only routes audio (and MIDI) streams between applications (and/or audio hardware!) with only one format for audio data. It provides tools to measure and reduce latency and handles synchronization between apps (very important for serious real-time audio applications). It's very similar to CoreAudio. IMHO OpenAL is a end-user-oriented API, while Jack is more like a backend. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: GNUstep on DirectFB
Lisbon Acid a écrit : The drawing and compositing of surfaces is done with OpenGL (right now, just offscreen software rendered mesa). Did you write a pure OpenGL backend for GNUstep ??? wow ;) AFAIK Cairo supports DirectFB as an 'experimental' backend, and Cairo is the preferred backend for GNUstep graphics. I would start from there. http://www.directfb.org/wiki/index.php/DirectFB_2.0:_Cairo_Support http://git.directfb.org/?p=ports/cairodfb.git;a=tree Regards - Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: [Urgent] GNUstep at Google Summer of Code'2009
Hi, Riccardo Mottola a écrit : Hi Xavier, Does GAP stand for Application project ? Does that mean that any GNUstep/Cocoa based project could be submitted ? And not only GNUstep specific. - new 3DKit - multiplatform OpenGL extensions API (glu-like) - multiplatform HID API : joystick... Or any graphic or gaming related project in which some students will surely be interested. Well GAP stands for GNUstep Application Project. So The focus is GNUstep, not just any application. We strive to be cross-platform with Cocoa though and have several applications ported /from/ OpenStep or Cocoa as well as ported /to/ them. Currenly GAP has a lot of applications, several of them never announced because they are far from complete. My biggest interest would be to finish them off, but this is of course not so interesting for a student. The only exception might be FlexiSheet. A project could be: take application X and port it to gnustep. Another one could be: write one from scratch. (...) Instead of Games, I think user application, office appplication, developer applications and system tools are far more important (but maybe less cool for students). (...) Of course, theses projects would be x-Step based. I thought of some simple projects and some more difficult ones. I dont think we should spend many time on dead or forgotten apps, like Flexisheet. A GNUstep gui would be fine, but would die soon because of the lack of an application maintainer. That would also occur in th case of an application written from scratch. IMHO OpenOffice for GNUstep might be more promising than FlexiSheet, despite OpenOffice is not a so good application. Gnumeric (Gnome) or KSpread (KDE) might also be good candidates, even if only the core engine is used. But I agree with you : a good x-Step based speadsheet would be more interesting than any classic spreadsheet port ;) -- Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: [Urgent] GNUstep at Google Summer of Code'2009
Adam Fedor a écrit : On Mar 12, 2009, at 7:14 AM, Xavier Glattard wrote: Huh... I can't : the page is locked. What do I need to do ? Or maybe someone could insert the attached file... Thanks! And please add my name in the list of mentors : Xavier Glattard Please send a mail to webmasters AT gnustep.org with your wiki login name so that you can get write privileges. Done, thanks :) Also, please try to make sure any ideas are something that could easily get done by a student in a summer (so, perhaps, it is something you could do in a month of work). Then I have to forget half of my ideas : in most case I'm not sure of anything. Some ports might look easy (small apps), but will involve a lot of CF conversion. I agree : some of my suggested projects might be huge for one student. But for 2 ? And I could keep on the work when the summer will gone for some of these projects in which I'm interested. I'm sure nobody could port OpenOffice in a summer. But this project might lead to some CoreFoundation compatible functions :) Porting WebKit would also be a huge task. Should I leave some of my ideas ? OpenOffice ? Gecko ? Also, I hope to concentrate on ideas that would get us towards a GNUstep 1.0 release faster (i.e. fixing up the rough edges). I work on GNUstep since months and I only start to (mis)understand some small parts. Students might be smarter than I'm, but nobody is very efficient in debugging/enhancing an unknown program. Well, I'm not :\ - Regards -- Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: ABI Compatibility (was Re: Installation woes for the average user...)
David Ayers a écrit : Hello Xavier, Am Dienstag, den 10.03.2009, 17:49 +0100 schrieb Xavier Glattard: (...) This is the same behavior than 'classic' external ivars, but the memory is allocated along with the instance itself (remember: the question is 'no extra malloc call'). The pointer to external ivars is not stored as is, but is computed with self and instance_size. Still an 'extra load', but not more than with a compiler-side solution. I even think this is a 'hand made' non-fragile ivar system, with no need for compiler support. And the alignment issue seems to be solved with padding in NSObject.m:334-371 All true but you need consider the assembler code that the compiler emits to access the ivar in each class. And here the parent and the subclass will disagree on what the offset to a_ext is. This offset is currently an offset fixed at compile time by the compiler's calculation of: struct { @defs(ParentClass) } *obj; obj[1] /* the address of a_ext */ which cannot take into account the ivars of potential subclasses, which will be at that exact same address (i.e obj[1] == b). It takes the non-fragile ivars to replace the fixed value (calculated and emitted by the compiler) into a lookup to the actual offset/location of the value. This mechanism can only be provided by a newer compiler emitting that lookup code instead of using the fixed offsets. Hope that makes it clear why using the extra data prevents subclasses from adding ivars. All this is now very clear for me ;) At first I forgot that 'self+1' is evaluated by the compiler and then parent and subclasses get the same value when they should not. But David Chisnal introduced the 'isa-instance_size' value, that is evaluated at runtime. Anyway I agree with many (all?) of you : this is quite an ugly solution, with some drawbacks. What about this Obj-C linker that would load the library version needed by the application? - Regards -- Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: [Urgent] GNUstep at Google Summer of Code'2009
Adam Fedor a écrit : On Mar 10, 2009, at 7:25 AM, Xavier Glattard wrote: I don't know what are the requirements for mentors, but I would be glad to help and take care of one small project :) A big factor in how many students google gives us is the number of students who apply to work with us, so the more ideas and more advertisement we get, the better chance to get more students and more work done. So i just have to add my name and (many) ideas in the lists ? I don't live in a big city. I can think of 2 or 3 tiny computer engineering schools nearby (less than 100km). Around 100 students. I don't expect many of these students would apply to work on GNUstep. Do we have to rely on Google for advertisement ? As I'm working on gscoredata I can submit some ideas about it. Some of the already submitted ideas will still apply after my work. http://wiki.gnustep.org/index.php/Summer_Of_Code_Ideas - SQLite, XML, binary, etc. NSPersistentStore subclasses - improve DataBuilder.app - file formats compatible with Cocoa, including model. About the backend : - unified backend : Windows and X11 backends share a lot of functionalities... - Cairo/Glitz/OpenGL backend : needs some work on Glitz I'm afraid - Cairo/DirectFB backend : someone posted here about that some months ago About AppKit: - NSMovie/QTMovie class based on vlc or other... - NSOpenGLPixelBuffer class Does GAP stand for Application project ? Does that mean that any GNUstep/Cocoa based project could be submitted ? And not only GNUstep specific. - new 3DKit - multiplatform OpenGL extensions API (glu-like) - multiplatform HID API : joystick... Or any graphic or gaming related project in which some students will surely be interested. Some open source Cocoa applications might be ported to GNUstep: - Vim GUI : two cocoa-based gui projects already exist - Mozilla Gecko : many cocoa projects - OpenOffice : released some week ago - VLC - NetHack3D http://www.cocoadev.com/index.pl?CocoaOpen http://osx.hyperjeff.net/Apps/apps?sub=100t=1s=on If there is no objection I will soon add these ideas in the list. - Regards -- Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: ABI Compatibility (was Re: Installation woes for the average user...)
Riccardo Mottola a écrit : (...) David Chisnall wrote: (...) Yes, this appears to me the least hurting path. But I laready dislike. If we really need, this should be the road. If you make private ivars into a structure and make a pointer to this an ivar, you add an extra malloc for every +alloc (expensive) and you add an extra load for ever ivar access. That is an abomination. Another stupid question : the memory allocation function accepts an 'extraBytes' parameter. These bytes are allocated _after_ the instance bytes by the same 'malloc' call. Couldn't this system be adapted to ivar storage ? The extra storage is at self+1 : no need for an additional pointer, and no extra load for ivar access. @interface NSObject (ExtraMemory) + (id) allocWithZone: (NSZone*)zone extra: (size_t) extraBytes; @end Usage typedef struct _LibraryClass_ext_st { int ivar1; int ivar2; } _LibraryClass_ext; #define LIBRARYCLASS_EXTRA(obj) ((_LibraryClass_ext*)((obj)+1))) @implementation LibraryClass - (id) allocWithZone: (NSZone*)z { return [self allocWithZone: z extra: sizeof(_LibraryClass_ext)]; } - (int) var1 { return LIBRARYCLASS_EXTRA(self)-ivar1; } @end ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: ABI Compatibility (was Re: Installation woes for the average user...)
David Chisnall a écrit : On 10 Mar 2009, at 10:28, Xavier Glattard wrote: Riccardo Mottola a écrit : (...) David Chisnall wrote: (...) Yes, this appears to me the least hurting path. But I laready dislike. If we really need, this should be the road. If you make private ivars into a structure and make a pointer to this an ivar, you add an extra malloc for every +alloc (expensive) and you add an extra load for ever ivar access. That is an abomination. Another stupid question : the memory allocation function accepts an 'extraBytes' parameter. These bytes are allocated _after_ the instance bytes by the same 'malloc' call. Couldn't this system be adapted to ivar storage ? The extra storage is at self+1 : no need for an additional pointer, and no extra load for ivar access. The extra bytes are allocated after the object, which would be completely useless. Imagine: (...) Now you add another ivar to A and remove the extra bytes, and you have this layout: id isa;// offset 0 int a;// offset 4 int a1;// offset 8 int b;// offset 12 - This has now moved and class B needs recompiling, as do any subclasses of B. Yes, but this is the case we want to avoid with the use of extra bytes! -- do not insert ivar, add it in extra bytes Alternatively, you could try storing the data in the extra bytes, so the layout would be: (...) We now have three different classes, with offsets of 8, 12 and 24, respectively for the a1 ivar. Every method that attempted to access this ivar would need to determine which class it is and calculate the offset. This would need a macro like this: #define a1 (*((int*)(((char*)self) +isa-instance_size))) This would be really horrible and error-prone (this macro doesn't take into account alignment, so is only valid for architectures like x86, with no strict alignment requirements (as long as none of the ivars are vectors), and would break on SPARC and similar archs. The next ivar you add would need an even more complex macro to account for the alignment of a1. This ivar would not be exposed via any introspection, so you couldn't use it with KVC/KVO, bindings, or EtoileUI without writing even more code. In short, this adds a lot more problems than it solves. The extra storage is not at self+1 unless self is cast to the correct subclass first. Pointer arithmetic like that only works when the size of the pointee is known at compile time, which is not the case for Objective-C objects, except in the trivial case of classes with no subclasses, which do not encounter this problem to start with. David The extra bytes are already used in some class in GNUstep (GSString, GSArray...) and AKAIK there is no problem with system arch. In GSArray.m:417 : _content_array = (id*)self[1]; So my 'self+1' was not so naive ;) I have no idea of the macro that would be written for this task. Yours is very ugly ;) But it'd have to be writen only once if the extra bytes are defined as a structure. And then it would not be so error prone. // In NSObject #define OBJECT_EXTRA_PTR ((void*)(((char*)self) +isa-instance_size)) // In FooClass struct _foo_extra_st { int a1; } _foo_extra; #define FOO_EXTRA (*(_foo_extra*)(OBJECT_EXTRA_PTR)) - (int) a1 { return FOO_EXTRA.a1; } You may find two other examples in GSString.m: 633, 3087 Anyway that's only an idea, not a solution. I'm convinced that the solution would be more 'political' than technical. Thank you for your patience. - Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: ABI Compatibility (was Re: Installation woes for the average user...)
David Chisnall a écrit : On 10 Mar 2009, at 14:27, Xavier Glattard wrote: David Chisnall a écrit : The extra bytes are allocated after the object, which would be completely useless. Imagine: (...) Now you add another ivar to A and remove the extra bytes, and you have this layout: id isa;// offset 0 int a;// offset 4 int a1;// offset 8 int b;// offset 12 - This has now moved and class B needs recompiling, as do any subclasses of B. Yes, but this is the case we want to avoid with the use of extra bytes! -- do not insert ivar, add it in extra bytes Right. Alternatively, you could try storing the data in the extra bytes, so the layout would be: (...) We now have three different classes, with offsets of 8, 12 and 24, respectively for the a1 ivar. Every method that attempted to access this ivar would need to determine which class it is and calculate the offset. This would need a macro like this: #define a1 (*((int*)(((char*)self) +isa-instance_size))) This would be really horrible and error-prone (this macro doesn't take into account alignment, so is only valid for architectures like x86, with no strict alignment requirements (as long as none of the ivars are vectors), and would break on SPARC and similar archs. The next ivar you add would need an even more complex macro to account for the alignment of a1. This ivar would not be exposed via any introspection, so you couldn't use it with KVC/KVO, bindings, or EtoileUI without writing even more code. In short, this adds a lot more problems than it solves. The extra storage is not at self+1 unless self is cast to the correct subclass first. Pointer arithmetic like that only works when the size of the pointee is known at compile time, which is not the case for Objective-C objects, except in the trivial case of classes with no subclasses, which do not encounter this problem to start with. David The extra bytes are already used in some class in GNUstep (GSString, GSArray...) and AKAIK there is no problem with system arch. GSArray is a private GNUstep class. It is not exposed in headers anywhere and can not be subclassed by anything external to GNUstep. In GSArray.m:417 : _content_array = (id*)self[1]; So my 'self+1' was not so naive ;) See above. This only works in the special case where the class has no subclasses. Create a subclass of GSArray, add an instance variable, and watch everything go badly wrong. This discussion is only relevant to classes which will be subclassed in third-party apps and frameworks. Private classes are not part of the public ABI and so are completely irrelevant. You can do whatever you want with a class that won't be subclassed, or for which you control all of the subclasses. You can't do any of these tricks with a class intended for subclassing, and these classes are the topic of the discussion. I have no idea of the macro that would be written for this task. Yours is very ugly ;) But it'd have to be writen only once if the extra bytes are defined as a structure. And then it would not be so error prone. Then the structure becomes part of the ABI and we're back where we started, only without introspection and reimplementing parts of the language in an inefficient and error-prone way. // In NSObject #define OBJECT_EXTRA_PTR ((void*)(((char*)self) +isa-instance_size)) // In FooClass struct _foo_extra_st { int a1; } _foo_extra; #define FOO_EXTRA (*(_foo_extra*)(OBJECT_EXTRA_PTR)) - (int) a1 { return FOO_EXTRA.a1; } Right, and now try having two classes using this mechanism. The subclass will need to know the offset from the parent. It quickly becomes horribly unmaintainable, it adds an extra layer of indirection, and provides no real benefits. It also breaks any classes that use the extra bytes mechanism themselves. And, as I said, it also breaks introspection, which will make all sorts of things that use the more advanced features of Objective-C fail silently and in a manner that is almost impossible to debug. You may find two other examples in GSString.m: 633, 3087 GSString is another private class. It is completely irrelevant. Anyway that's only an idea, not a solution. Correct. I'm convinced that the solution would be more 'political' than technical. Totally agree. In many cases, avoiding changing the ABI can be avoided or postponed, but there needs to be an attitude that it is something that we want to avoid, rather than something to do because it's easy. Until we have non-fragile ivars in the runtime, anyway, at which point the whole discussion becomes academic. David I'm sorry, i still can't see any problem. NSAllocateObject is implemented as this : (NSObject.m:767) size = aClass-instance_size + extraBytes + sizeof(struct obj_layout); new = NSZoneMalloc(zone, size); Then the extra bytes are allocated always _after_ the class ivar, whatever the class is : the parent class
Re: RFA: patches
ici...@mail.cg.tuwien.ac.at a écrit : Hi! This is just a heads-up for my patches, since I don' want to commit them without your feedback. 1. I implemented key repeat support for keyboard events in GServerEvent 2. I implemented mouse position setting support in GSDisplayServer and XGServerWindow. I really need that feature in any serious OpenGL application. 3. I did some NSOpenGL improvements, like multisampling support. I think I should coordinate my work there with Xavier and Matt. Thanks ;) I didn't test your patch, only read. Looks fine! You did a lot of cleaning in OpenGL code. One question : don't you think [+glxMinorVersion] should be in XGServer? - Regards -- Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: ABI Compatibility (was Re: Installation woes for the average user...)
Richard Frith-Macdonald a écrit : On 6 Mar 2009, at 07:05, Xavier Glattard wrote: Hi I dont understand this problem about ABI and binary compatibility, so please excuse me if this looks stupid :\ The problem comes from ivars that would not be always at the same offset, doesn't it ? But these ivars are supposed to be private, dont they ? So the code that uses these ivars is always released along with the class interface. I can not find any official 'public' ivars. Do i miss something ? There are all sorts of possible issues with symbol names when functions and global variables etc are added/removed/changed, but the main issue we are talking about is the ivar layout and subclassing. If you add an ivar to a class, the memory used by and instance becomes bigger to make room for it. If you link in some bundle or library which uses a subclass of that class, the bundle/library will not be expecting that ivar to be there, and will have stored one of the subclass ivars at the oiffset in memory where the new ivar is stored ... causing obvious problems. David's solution of non-fragile ivars requires compiler and runtime support, but is definitely the way to go to solve the problem (except for when the very highest performance is needed, in which case you can usually use straight C and other techniques for optimisation). Fred, Richard : thank you for your answers. I think I understand the 'technical' problem :) But IMHO : - private ivars should (can?) not be used from outside the class itself. - protected ivars should only be used from inside the library/framework itself, and only for very good reason. - public ivars should not exist! Moreover ivars are never documented. Then GNUstep users should never meet this problem. If they do then I think this is their own choice. Do i still miss something ? -- Regards ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: ABI Compatibility (was Re: Installation woes for the average user...)
Richard Frith-Macdonald a écrit : On 6 Mar 2009, at 09:15, Xavier Glattard wrote: Richard Frith-Macdonald a écrit : On 6 Mar 2009, at 07:05, Xavier Glattard wrote: Hi I dont understand this problem about ABI and binary compatibility, so please excuse me if this looks stupid :\ The problem comes from ivars that would not be always at the same offset, doesn't it ? But these ivars are supposed to be private, dont they ? So the code that uses these ivars is always released along with the class interface. I can not find any official 'public' ivars. Do i miss something ? There are all sorts of possible issues with symbol names when functions and global variables etc are added/removed/changed, but the main issue we are talking about is the ivar layout and subclassing. If you add an ivar to a class, the memory used by and instance becomes bigger to make room for it. If you link in some bundle or library which uses a subclass of that class, the bundle/library will not be expecting that ivar to be there, and will have stored one of the subclass ivars at the oiffset in memory where the new ivar is stored ... causing obvious problems. David's solution of non-fragile ivars requires compiler and runtime support, but is definitely the way to go to solve the problem (except for when the very highest performance is needed, in which case you can usually use straight C and other techniques for optimisation). Fred, Richard : thank you for your answers. I think I understand the 'technical' problem :) But IMHO : - private ivars should (can?) not be used from outside the class itself. - protected ivars should only be used from inside the library/framework itself, and only for very good reason. - public ivars should not exist! Moreover ivars are never documented. Then GNUstep users should never meet this problem. If they do then I think this is their own choice. Do i still miss something ? (...) but the actual layout at runtime is { Class isa; int _ivar1; int _ivar2; NSString *name; } so the assignment actually overwrites _ivar2 (...) I have think of this, but i could not consider the compiler is so stupid! Thank you for your patience. Anyway, do you think we should rely on a (non-existent) compiler feature ? It takes a long time for new compiler release to reach end users. Is the compatibility with gcc 2.95 a forgotten dream ? ;) Do you think a backward compatible version of some classes might be created at each release ? Additional ivars would be stored externally in a map table : slow but simple. This version of the class would be loaded at runtime, but would be private and only the new version could be used by a compiler. The implementation file could be easily shared by both version (if not the implementation itself with the use of accessors) == LibraryClass.h #ifndef __GSLibraryClass_Version_flag__ #define __GSLibraryClass_Version_flag__ int __GSLibraryClass_mandatory_version = 0x0200; // not extern ! #enfif @class LibraryClass_old; @interface LibraryClass: LibraryClass_old { @private // int_ivar1; -- inherited int_ivar2; } - int var2; - int twice; @end LibraryClass.m #define __GSLibraryClass_Version_flag__ extern int __GSLibraryClass_mandatory_version; static int __GSLibraryClass_version = 0x0200; #include LibraryClass.h @interface LibraryClass_old : NSObject { @protected int_ivar1; } @end @implementation LibraryClass_old static GSIMap * _ivar2_store; - int var2 { return [_ivar2_store valueForKey: self]; } - int twice { return [self var2] * 2; } @end @implementation LibraryClass + (id) alloc { if ( __GSLibraryClass_version != __GSLibraryClass_mandatoryVersion ) { return [LibraryClass_old alloc]; } else { return [super alloc]; } } - int var2 { return _ivar2; } // if needed : - int twice { return _ivar2 * 2; } @end = Some good old MACROS might be helpful. I know there are some MACROS gurus around ;) Just an idea. Maybe too complicated. -- Regards - Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: ABI Compatibility (was Re: Installation woes for the average user...)
Hi I dont understand this problem about ABI and binary compatibility, so please excuse me if this looks stupid :\ The problem comes from ivars that would not be always at the same offset, doesn't it ? But these ivars are supposed to be private, dont they ? So the code that uses these ivars is always released along with the class interface. I can not find any official 'public' ivars. Do i miss something ? And if the ivars need to be used from outside the library/bundle (for internal use), why not access them thru accessors? Obj-C accessors or even simple C function that would read or write the value, or return a pointer, or even a member pointer (offset)... My 2 cts. -- Regards - Xavier Gregory Casamento a écrit : The last collective release was only two months ago. As far as the ABI is concerned that is certainly an issue. The last time we discussed it we came up with two solutions: * Pad the ivar-structures in the classes out to give space to grow so that it pushes off any ABI compatibility issues as long as possible. This is why in some APIs, including Cocoa, you see things like reserved... or private... variables. These are there to give room to grow. The disadvantage is that the classes would then take up more memory as a result. * Move the ivar-structures out of the classes and replace them with a void pointer to the actual structure. This has the advantage that we will never be able to break ABI compatibilty since the sizes of the structs in the classes will not change... but it also has the disadvantage of adding a layer of complexity to getting and setting variables as well as potentially causing unpredictable issues due to unforseen incompatibilities such as cases where the wrong data is written into a data structure causing some sort of corruption when using the wrong version of a library. I, personally, think we should implement the first option. It's the method most APIs follow and it is the method that is the most predictable. It would take some effort to do this, but it's minimal since it's really just padding the structures with a given amount of space. GC P.S. Sorry for the double mail, Stefan, I meant to reply to all, but curse gmail it defaults to reply. :) On Thu, Mar 5, 2009 at 8:35 AM, Stefan Bidigaray stefanb...@gmail.com mailto:stefanb...@gmail.com wrote: I thought that's what GNUstep-startup was supposed to be used for? I've personally never used it, but the way I understand it all you need to do is ./InstallGNUstep, right? In my opinion, it's more important to have up-to-date packages than anything else, however, one needs to keep in mind that most distributions do not follow the latest and greatest. I, for example, use Debian Testing + GNOME most of the time and I know I will never have the latest release of packages, people need to realize this. Tell you the truth, except for when I create GNUstep packages and build scripts for Slackware, I never compile a single piece of software. Why is it different with GNUstep? Why do people WANT to compile in the first place? If I can rant a little... GNUstep also gets way behind when it comes to releases. How long has it been since the last collective release? Why isn't GNUstep releasing more stable releases? It seems everytime a new release of the core packages are out I need to recompile everything because it breaks ABI. Rarely do I see a x.x.1 release. I've been wanting to bring that up for a while, figured this was as a good a time as any. Stefan On Wed, Mar 4, 2009 at 10:33 PM, Gregory Casamento greg.casame...@gmail.com mailto:greg.casame...@gmail.com wrote: Hey guys... it seems to me that the build guides for building from source that we have are out of date. Could we move some of this stuff to the wiki so that it can be more readily maintained? Also, it seems like a lot of users are having issues using GNUstep because the packages are so old on many systems. Currently Hubert is working on What brought this up is that I was trying to help someone get gnustep installed since the packages are out of date. Anyone have any thoughts? GC -- Gregory Casamento Open Logic Corporation, Principal Consultant ## GNUstep Chief Maintainer yahoo/skype: greg_casamento, aol: gjcasa (240)274-9630 (Cell), (301)362-9640 (Home) ___ Gnustep-dev mailing list Gnustep-dev@gnu.org mailto:Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev -- Gregory Casamento Open Logic Corporation, Principal Consultant ## GNUstep Chief Maintainer yahoo/skype: greg_casamento, aol:
Re: About OpenGL and NSView
Fred Kiefer a écrit : Xavier Glattard wrote: I would like to post some changes about OpenGL support. (in gui and x11-back, soon in win32-back) Great. I need to add a flag in NSView (in the _rFlags bit field). I think it would not break anything but i may miss something. Any advice ? Thanks! There is plenty of space in that field left. Soem time ago I wanted to move all the other boolean flags of NSView into that field too, but didn't dare to do this as it might break subclasses. But a new entry wont cause trouble. What will that new bit be used for? I found out that the backing store of the OpenGLView is marked as dirty then flushed after each drawing loop. This is useless because openGL does not draw anything on the backing store. So I created a 'ignore_backing' flag that says the NSView does not need to trigger a flush. This flag is set by GLContext when it is attached to a view. I get a 30% speed improvement! (same speed than non retained backing store) Moreover i think this change will fix the bug I submitted some days ago about flickering win32 opengl window. I'm about to check this. Fred: I've just updated my tree with your last changes some days ago. Revision 27944 seems to break NSOpenGLView position: the view is moves left and up -ward. IMHO settting the background color (Rev 27945) is useless because the GL context MUST clear the background (on my system). I only set the background colour to avoid random patterns being displayed before the OpenGL rendering starts. It made a difference for me. I understand. I suppose my computer is too fast... (???) As for the change 27944, most likely the removal of that strange coordinate conversion makes the difference for you. With the current code things look correct for me with and without GNUstep drawing the windows decoration. (This being on Linux, not Windows) I have attached two screen shots of Gears to show the result. If things look different for you, we need to find out what may cause the difference. Are you using any GNUstep additions or themes? If you look carefully your screenshots you can see that the GL view is shifted upward and to the right. It looks slightly different on my system because I use WMaker. I think the shift comes from the width of the window decorations : bottom and left borders. These are small on your system. The bottom border width is larger with WMaker. I dont understand where these come from. It looks like the window decorations widths are always used to convert coordinates, even if the backend does not handle them. There is no problem with NSViews because they are relative to the contentView. But the OpenGL subwindow is relative to the XWindow! If you draw the background of the GL view (with NSRectFill) you can see that only the sub-window is shifted, not the NSView. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
About OpenGL and NSView
Hi I would like to post some changes about OpenGL support. (in gui and x11-back, soon in win32-back) I need to add a flag in NSView (in the _rFlags bit field). I think it would not break anything but i may miss something. Any advice ? Thanks! Fred: I've just updated my tree with your last changes some days ago. Revision 27944 seems to break NSOpenGLView position: the view is moves left and up -ward. IMHO settting the background color (Rev 27945) is useless because the GL context MUST clear the background (on my system). -- Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
About OpenGL and NSView
Hi I would like to post some changes about OpenGL support. (in gui and x11-back, soon in win32-back) I need to add a flag in NSView (in the _rFlags bit field). I think it would not break anything but i may miss something. Any advice ? Thanks! Fred: I've just updated my tree with your last changes some days ago. Revision 27944 seems to break NSOpenGLView position: the view is moves left and up -ward. IMHO settting the background color (Rev 27945) is useless because the GL context MUST clear the background (on my system). -- Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSWindow NSGraphicsContext issue
Fred Kiefer fredkiefer at gmx.de writes: Last week I tried to resolve a circular refernce problem between NSWindow and NSGraphicsContext. The window in the dictionary is (should be) only used when creating the context : delete the dictionary after use or remove the window from the ddictionary. You might keep the window (if needed) in a non retained ivar : no cycle! Too simple...? Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
If writting xml for Renaissance is coding then yes. When you write a Renaissance file you define the properties of the objects, and links between objects. When you write code you define the behavior of the objects. To write a gui for an application you can write objc code, you can use IB/Gorm, or you can write gsmarkup for Renaissance. I prefer the third way. If i could write the whole app the same way i would be happy :-) Selon Gregory John Casamento [EMAIL PROTECTED]: Aren't you effectively writing code when you create the XML by hand? Gregory Casamento -- Principal Consultant - OLC, Inc # GNUstep Chief Maintainer - Original Message From: Xavier Glattard [EMAIL PROTECTED] To: Gregory John Casamento [EMAIL PROTECTED] Cc: Xavier Glattard [EMAIL PROTECTED]; Nicola Pero [EMAIL PROTECTED]; Fred Kiefer [EMAIL PROTECTED]; gnustep-dev@gnu.org Sent: Saturday, March 29, 2008 6:28:52 PM Subject: Re: bindings and Renaissance Selon Gregory John Casamento [EMAIL PROTECTED]: One thing that springs immediately to mind is the connector classes for Binding. They have to be finished. Are you going to be using these in Renaissance? Do you currently use the existing connector classes? Mostly curious. :) GJC Gregory Casamento -- Principal Consultant - OLC, Inc # GNUstep Chief Maintainer I don't currently use any other connector, i'm new to Renaissance, but i'll work on it. Well... i'm lazy Renaissance is a tool to build a gui without code. Bindings are tools to bind a gui to a model without code. I'm looking to Core Data that is a tool to build model without code. So : yes i would like to use Bindings in Renaissance. I would like to get a full RAD environment with GNUstep that allows to build an application without... you know what. Only XML. And if i really need some code i might use steptalk. Xavier, lazy dreamer ^_^ ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
Selon Fred Kiefer fredkiefer at gmx.de: 1) Examples/bindings.gsmarkup, two textFields, one value. I had to create two bindings between the two fields. I thought a bindings was two-way (...) In bindings.gsmarkup i define 2 textFields. First i bind the 1st field to the 2nd one : [first bind:value toObject:second ...] If i change the value of the 1st field, the 2nd one is updated. But I expected that the value of the 1st would be updated when the value of the 2nd one changes. To get that behavior i have to bind the 2nd field to the first. [second bind:value toObject:first ...] I think that is the expected behaviour. At least it was what I implemented :-) I get a good behavior (two-way) when the fields are updated through a NSObjectController : both fields are bound to the controller content. (see the new version of the example on the svn repos) A NSControl can be bound, but can it be KVObserved ? (ie be the target of a binding) I think NSControl and (some?) subclasses are not KVC compliant : the accessors are probably not used internally and observer notifications should be send manually. Or some [setKeys:triggerChangeNotificationsForDependentKey:] would be needed. Or I need to find a key that is KVC compliant... Anyway i dont care about binding two fields. Useless :-) 2) Examples/stepper-bindings.gsmarkup (...) /.../gnustep/libs/renaissance/Tools/GSMarkupBrowser.app/GSMarkupBrowser: Uncaught exception NSGenericException, reason: Glyph generation was triggered for a layout manager while the text storage it was attached to had unprocessed editing. This is not allowed. Glyph generation may be triggered only at points where calls to -beginEditing and -endEditing are balanced. It doesn't look like a binding issue... Maybe Renaissance autolayout system ? I don't think so. More a problem in the text system. Could you please send me a back trace from gdb? I would like to understand what is triggering the text change here. There was an error in my example : i tried to bind a stepper value to a stringValue. If the stepper is bound to an intValue it's ok. Anyway you can get a bt is attached. The Glyph error seems to occur in an exception panel... ??? Thanks Xavier #0 0xb7f7e410 in ?? () #1 0xbfc23b18 in ?? () #2 0x0006 in ?? () #3 0x1f7a in ?? () #4 0xb7622811 in raise () from /lib/tls/i686/cmov/libc.so.6 #5 0xb7623fb9 in abort () from /lib/tls/i686/cmov/libc.so.6 #6 0xb78a5e9c in _terminate () at NSException.m:695 #7 0xb78a60b6 in _NSFoundationUncaughtExceptionHandler (exception=0x81bcdd8) at NSException.m:722 #8 0xb78a682c in -[NSException raise] (self=0x81bcdd8, _cmd=0xb7eea390) at NSException.m:862 #9 0xb7de2cd3 in -[GSHorizontalTypesetter layoutGlyphsInLayoutManager:inTextContainer:startingAtGlyphIndex:previousLineFragmentRect:nextGlyphIndex:numberOfLineFragments:] (self=0x82703b8, _cmd=0xb7ee8970, layoutManager=0x82741d8, textContainer=0x8274378, glyphIndex=0, previousLineFragRect={origin = {x = 0, y = 0}, size = {width = 0, height = 0}}, nextGlyphIndex=0xbfc23e7c, howMany=0) at GSHorizontalTypesetter.m:1278 #10 0xb7ddb9e6 in -[GSLayoutManager(LayoutHelpers) _doLayoutToContainer:] (self=0x82741d8, _cmd=0xb7ee8958, cindex=0) at GSLayoutManager.m:1689 #11 0xb7ddd530 in -[GSLayoutManager(layout) usedRectForTextContainer:] (self=0x82741d8, _cmd=0xb7ea8fa0, container=0x8274378) at GSLayoutManager.m:2283 #12 0xb7d29423 in cache_lookup_attributed_string (string=0x81950f0, hasSize=0, size={width = 0, height = 0}, useScreenFonts=1) at NSStringDrawing.m:346 #13 0xb7d29e58 in -[NSAttributedString(NSStringDrawing) size] (self=0x81950f0, _cmd=0xb7e44dc0) at NSStringDrawing.m:501 #14 0xb7c2daac in -[NSCell cellSize] (self=0x81a3c00, _cmd=0xb7e3a360) at NSCell.m:1792 #15 0xb7c13563 in -[NSBox(Private) calcSizesAllowingNegative:] (self=0x81bde48, _cmd=0xb7e3a288, aFlag=0 '\000') at NSBox.m:689 #16 0xb7c10570 in -[NSBox setContentView:] (self=0x81bde48, _cmd=0xb7e3a268, aView=0x81bc998) at NSBox.m:271 #17 0xb7c0fcc0 in -[NSBox initWithFrame:] (self=0x81bde48, _cmd=0xb7e2aa70, frameRect= {origin = {x = 0, y = 95}, size = {width = 362, height = 2}}) at NSBox.m:92 #18 0xb7bd9c04 in -[GSAlertPanel _initWithoutGModel] (self=0x8264868, _cmd=0xb7e2aa40) at NSAlert.m:394 #19 0xb7bd8c3d in -[GSAlertPanel init] (self=0x8264868, _cmd=0xb7e2ae88) at NSAlert.m:247 #20 0xb7bdec87 in -[GSExceptionPanel init] (self=0x8264868, _cmd=0xb7e2ad68) at NSAlert.m:1727 #21 0xb7bde9c4 in GSRunExceptionPanel (title=0x81b8708, exception=0x81a1278, defaultButton=0x81cb3b0, alternateButton=0x0, otherButton=0x8242058) at NSAlert.m:1693 #22 0xb7beb984 in _NSAppKitUncaughtExceptionHandler (exception=0x81a1278) at NSApplication.m:126 #23 0xb78a6821 in -[NSException raise] (self=0x81a1278, _cmd=0xb7ae1aa0) at NSException.m:853 #24 0xb78a627e in +[NSException raise:format:arguments:] (self=0xb7ae1880, _cmd=0xb7ae1a88,
Re: bindings and Renaissance
Selon Nicola Pero [EMAIL PROTECTED]: In bindings.gsmarkup i define 2 textFields. First i bind the 1st field to the 2nd one : [first bind:value toObject:second ...] If i change the value of the 1st field, the 2nd one is updated. But I expected that the value of the 1st would be updated when the value of the 2nd one changes. To get that behavior i have to bind the 2nd field to the first. [second bind:value toObject:first ...] I think that is the expected behaviour. At least it was what I implemented :-) Yes, on Apple Mac OS X it seems to work in the same way. :-) I'm quite suprised that an Apple made class is not KVC compliant. But i may have miss something. Thank you for the test :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
Selon Fred Kiefer [EMAIL PROTECTED]: 1) Examples/bindings.gsmarkup, two textFields, one value. I had to create two bindings between the two fields. I thought a bindings was two-way (...) You do understand that the binding behaviour is not symmetrical? May be i don't... I get the expected behavior when the fields are updated through a NSObjectController : both fields are bound to the controller content. (see the attached file) A NSControl can be bound, but can it be KVObserved ? (ie be the target of a binding) Anyway i dont care about binding two fields. Useless :-) Xavier bindings.gsmarkup Description: Binary data ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
Selon Fred Kiefer fredkiefer at gmx.de: 1) Examples/bindings.gsmarkup, two textFields, one value. I had to create two bindings between the two fields. I thought a bindings was two-way (...) In bindings.gsmarkup i define 2 textFields. First i bind the 1st field to the 2nd one : [first bind:value toObject:second ...] If i change the value of the 1st field, the 2nd one is updated. But I expected that the value of the 1st would be updated when the value of the 2nd one changes. To get that behavior i have to bind the 2nd field to the first. [second bind:value toObject:first ...] I think that is the expected behaviour. At least it was what I implemented :-) I get a good behavior (two-way) when the fields are updated through a NSObjectController : both fields are bound to the controller content. (see the new version of the example on the svn repos) A NSControl can be bound, but can it be KVObserved ? (ie be the target of a binding) I think NSControl and (some?) subclasses are not KVC compliant : the accessors are probably not used internally and observer notifications should be send manually. Or some [setKeys:triggerChangeNotificationsForDependentKey:] would be needed. Or I need to find a key that is KVC compliant... Anyway i dont care about binding two fields. Useless :-) 2) Examples/stepper-bindings.gsmarkup (...) /.../gnustep/libs/renaissance/Tools/GSMarkupBrowser.app/GSMarkupBrowser: Uncaught exception NSGenericException, reason: Glyph generation was triggered for a layout manager while the text storage it was attached to had unprocessed editing. This is not allowed. Glyph generation may be triggered only at points where calls to -beginEditing and -endEditing are balanced. It doesn't look like a binding issue... Maybe Renaissance autolayout system ? I don't think so. More a problem in the text system. Could you please send me a back trace from gdb? I would like to understand what is triggering the text change here. There was an error in my example : i tried to bind a stepper value to a stringValue. If the stepper is bound to an intValue it's ok. Anyway you can get a bt there : http://amstradstuff.free.fr/GNUstep/stepper-error.bt.log The Glyph error seems to occur in an exception panel... ??? Thanks Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
Selon Nicola Pero [EMAIL PROTECTED]: In bindings.gsmarkup i define 2 textFields. First i bind the 1st field to the 2nd one : [first bind:value toObject:second ...] If i change the value of the 1st field, the 2nd one is updated. But I expected that the value of the 1st would be updated when the value of the 2nd one changes. To get that behavior i have to bind the 2nd field to the first. [second bind:value toObject:first ...] I think that is the expected behaviour. At least it was what I implemented :-) Yes, on Apple Mac OS X it seems to work in the same way. :-) I'm quite suprised that an Apple made class is not KVC compliant. But i may have miss something. Thank you for the test :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
ups. sorry for the multiple double posts (!) i thought some of them were lost :-/ ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
Selon Gregory John Casamento [EMAIL PROTECTED]: One thing that springs immediately to mind is the connector classes for Binding. They have to be finished. Are you going to be using these in Renaissance? Do you currently use the existing connector classes? Mostly curious. :) GJC Gregory Casamento -- Principal Consultant - OLC, Inc # GNUstep Chief Maintainer I don't currently use any other connector, i'm new to Renaissance, but i'll work on it. Well... i'm lazy Renaissance is a tool to build a gui without code. Bindings are tools to bind a gui to a model without code. I'm looking to Core Data that is a tool to build model without code. So : yes i would like to use Bindings in Renaissance. I would like to get a full RAD environment with GNUstep that allows to build an application without... you know what. Only XML. And if i really need some code i might use steptalk. Xavier, lazy dreamer ^_^ ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
Selon Nicola Pero [EMAIL PROTECTED]: 3) the 'sendActionOn' attribute seems broken, the textField only 'act' when i press the Enter key. Is it a Renaissance issue ? I'm not sure when textFields are expected to send their actions. On Apple Mac OS X they seem to send their action when you press the 'Enter' key, so I suppose that would match the GNUstep behaviour ? That might be desirable after all. Eg, if you have '34' in your textField and want to change it to '49', you may select the text, delete everything, then type '4' then type '9', and you only want the stepper to be updated when the final text is completed, ie, the 'Enter' key is pressed :-) You're right, but i thought one could change this behavior if needed. Actually if you type '49' (or anything) then leave the field (with TAB or a mouse click) the action is not triggered. This conforms to the Cocoa reference. I just read carefully the [sendActionOn:] reference and found out that only some mouse events are checked. But nothing changes with stepper.gsmarkup : the textField only acts when i press Enter. And i can't check the MacOS behavior. Thanks xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: bindings and Renaissance
Fred Kiefer fredkiefer at gmx.de writes: Xavier Glattard wrote: (...) 1) Examples/bindings.gsmarkup, two textFields, one value. I had to create two bindings between the two fields. I thought a bindings was two-way Could you please explain a bit more what you are expecting and what you get? The binding code in gui is still unfinished, but basic two way interaction should work, at least in the cases where the bindings are already defined. You do understand that the binding behaviour is not symmetrical? At least not in my implementation and I think that is how Apple handles it as well. Did you test your code on MacOSX, was there any difference in behaviour? I can't : no mac :-( In bindings.gsmarkup i define 2 textFields. First i bind the 1st field to the 2nd one : [first bind:value toObject:second ...] If i change the value of the 1st field, the 2nd one is updated. But I expected that the value of the 1st would be updated when the value of the 2nd one changes. To get that behavior i have to bind the 2nd field to the first. [second bind:value toObject:first ...] 2) Examples/stepper-bindings.gsmarkup NSStepper seems not to support binding properly : i get an error message about Glyph... And i had to define a target/action This description is not that helpful Could you please describe some more what should happen? I don't have the latest renaissance test code. In stepper-binding.gsmarkup i tried the same than in the previous example, but the 2nd field is a NSStepper. If I bind the stepper to the textField, i get the following error message when I click on the stepper : /.../gnustep/libs/renaissance/Tools/GSMarkupBrowser.app/GSMarkupBrowser: Uncaught exception NSGenericException, reason: Glyph generation was triggered for a layout manager while the text storage it was attached to had unprocessed editing. This is not allowed. Glyph generation may be triggered only at points where calls to -beginEditing and -endEditing are balanced. It doesn't look like a binding issue... Maybe Renaissance autolayout system ? Perhaps I should get that first and have a look. It may well be that you are trying to use an unsupported binding here. I only tried the value binding. New bindings are rather easy to add in gui, I am just a bit lazy. If that's easy I might try to do the job :-) I actually only need to know what is good and what is bad. 3) the 'sendActionOn' attribute seems broken, the textField only 'act' when i press the Enter key. Is it a Renaissance issue ? What did you set the sendActionOn mask to? Most likely this isn't supported for text fields at the moment. If you come up with a description of what Apple does, we might be able to supply something similar. See my other post. Thanks ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
bindings and Renaissance
Hello I'm playing with Renaissance : i just add a 'bind' tag and some examples. bind source=#source label=binding target=#target key=key.path/ is (or should be) equivalent to : [#source bind: @binding toObject:#target withKeyPath:@key.path options:nil] But the examples do not work as expected. 1) Examples/bindings.gsmarkup, two textFields, one value. I had to create two bindings between the two fields. I thought a bindings was two-way 2) Examples/stepper-bindings.gsmarkup NSStepper seems not to support binding properly : i get an error message about Glyph... And i had to define a target/action 3) the 'sendActionOn' attribute seems broken, the textField only 'act' when i press the Enter key. Is it a Renaissance issue ? Did i miss something or does gnustep needs some fixings ? Thanks for your help. Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: gnustep on windows
Paul Fox paulfox at paxway.com writes: Ok, I've downloaded the patch and worked on merging the changes in CairoContext.m with the latest version (so pdf and ps output would still work) as well as cleaning up a few minor style things. It now compiles, but I get garbage when I try to run Gorm, and the GNUstep test appears to freeze. I can't find obvious errors in my modification, so is there some code somewhere else that's a problem? Here's the modified CairoContext.m: http://www.mediafire.com/?n2s1stkmu9c and here's the result I get for Gorm: http://www.mediafire.com/?ianwbjdsdxs Does anyone have any suggestions? Paul I just posted my code to the svn repos. There is no real difference between your code and mine so we should get the same results. First : the transparency in bitmap images is not render properly. Gorm : http://amstradstuff.free.fr/GNUstep/win32cairo-gorm.png The application is almost Ok. Only the Application window can not be used (the black box on the screen shot) I get many error msgs : 2008-03-04 13:15:01.842 Gorm[1964] Error while setting font matrix: out of memory 2008-03-04 13:15:01.852 Gorm[1964] Error while setting font matrix: out of memory 2008-03-04 13:15:01.942 Gorm[1964] Cairo status 'out of memory' in copy 2008-03-04 13:15:01.942 Gorm[1964] Cairo status 'out of memory' in copy (...) _cairo_win32_surface_set_clip_region: Descripteur non valide _cairo_win32_surface_set_clip_region: Descripteur non valide _cairo_win32_surface_set_clip_region: Descripteur non valide _cairo_win32_surface_set_clip_region: Descripteur non valide (...) _cai2008-03-04 13:15:02.573 Gorm[1964] Error while setting font matrix: out of memory 2008-03-04 13:15:02.573 Gorm[1964] Cairo status 'out of memory' in copy 2008-03-04 13:15:02.623 Gorm[1964] Error while setting font matrix: out of memory 2008-03-04 13:15:02.673 Gorm[1964] Error while setting font matrix: out of memory (...) 2008-03-04 13:15:31.555 Gorm[1964] Error while setting font matrix: out of memory ro_win32_surface_set_clip_region: Descripteur non valide _cairo_win32_surface_set_clip_region: Descripteur non valide _cairo_win32_surface_set_clip_region: Descripteur non valide (...) examples/Calculator : fine! examples/Ink : fine! examples/GSTest: most tests look Ok. NSViewAnimation-test crashes I probably had the same results one years ago when i write the code. I use cairo-1.4.14. My system : XP sp2 I wont work on this code before long. Feel free to hack this stuff :-) Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: gnustep on windows
Hello I just made some small changes in CairoContext.m The zip file has been updated : http://amstradstuff.free.fr/GNUstep/back-win32cairo.zip Cairo backend and Cairo/Glitz backend can be build and run. With Calculator and Gorm: Cairo backend : Text is Ok. Most bitmaps are ugly (transparency ?). With Gorm : many error log from GNUstep and Cairo. A black window. Glitz backend : everything is display in ONE window... I can put all this highly experimental stuff in the repository if you thing that may be useful. Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: gnustep on windows
Hello Some months (a year ?) ago i tried to write a Cairo backend for windows. You can get the files there : http://amstradstuff.free.fr/GNUstep/back-win32cairo.zip Put then in Source/cairo directory Achtung : two files will be overwritten !! I'm not sure they still can be build as cairo backend has been changed but they may be a first step. You will need FreeType and fontconfig. Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: GCC 4.1 on mingw platform
Christopher Armstrong carmstrong at fastmail.com.au writes: (...) Perhaps if we copied it out and wrote a GNUmakefile for it? That might work; it appears to be the approach with the GNUstep version of libobjc (although it has some extra patches against it AFAIK). It's far easier to use the gnustep libobjc ! (for me) But i think it's a shame to have to maintain this library only for mingw users when the gcc one would do the job as it does with linux... Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: GCC 4.1 on mingw platform
Christopher Armstrong carmstrong at fastmail.com.au writes: Has anyone else had any experience with gcc 4.1 on windows, particularly with GNUstep? It would be interesting to hear about other people's experience with this as well. Do people prefer cross-compilation (e.g. produce a gcc cross-compiler for mingw target on a linux host)? I hope this is not too off-topic for this list. I do ! $ ../gcc-4.1.2/configure --disable-win32-registry --disable-nls --enable-optimize --prefix=/mingw --enable-sjlj-exceptions --disable-shared --enable-threads --without-x --with-ld=/mingw/bin/ld $ make CFLAGS=-O2 -fomit-frame-pointer CXXFLAGS=-mthreads -fno-omit-frame-pointer -O2 LDFLAGS=-s bootstrap2 i got some info there : http://www.mingw.org/MinGWiki/index.php/How%20to%20Compile%20GCC%204.1 But that was not so complicated :-) (bison and flex are only needed with a snapshot, not with a release) I can't get GNUstep work with gcc libobjc (i posted here some weeks ago about that) because this library is build as static and should be shared... (--enable-shared=libobjc does not work ?!) I dont really understand :-\ Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: gui linking problem
Riccardo multix at ngi.it writes: Hi, after the fixes of NSAnimation and some other small stuff I fixed myself, gui compilation on my older box fails with: Compiling file set_show_service.m ... Linking tool set_show_service ... (...) ../Source/./obj/libgnustep-gui.so: undefined reference to `png_sizeof' (...) is png_sizeof something that hsould be provided by my png library? I still have installed: libpng-devel-1.2.5-1 libpng-1.2.5-1 I use libpng 1.2.15 from debian etch. png_sizeof is defined in /usr/include/libpng12/pngconf.h _as_a_macro_ ! Not sure, but... your problem seems to be elsewhere. Regards ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: problems compiling NSAnimation.m
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: On 10 May 2007, at 14:57, Xavier Glattard wrote: Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: (...) This macro is used as a macro : to repeat again and again the same piece of code. It only has to be used in this class. If you have two _NSANIMATION_LOCK then you have made an error : would you code two [NSThread -lock] in sequence ? You might ... if one method locks then calls another method which also locks. Of course, if this is possible then the lock needs to be a recursive one. We are talking of two _NSANIMATION_LOCK in sequence _in_the_same_method_. As it is present in (near) all methods IT IS called many time in sequence ! I fixed this to make __gs_isLocked an ivar rather than declaring it locally (which was pretty suboptimal). I also fixed a bug in the unlock macro (it was setting the lag to the wrong value), and added assertions to check that the macro is not misused. Bad. If __gs_locked is needed (and as i said i think it is not : i made an error) then it must be declared in all methods. If __gs_isLocked is an ivar, its value can be changed in another method then the [unlock] will never be called. Sure, but similarly if it's a local variable its value can be incorrectly changed within a method or function where it is declared. If it is then you made an other programming error... ;-) Its name is prefixed by an underscore (and by 'gs'!) so it shouldn't be used by anyone. Moreover an ivar is more easier to be incorrectly changed... in an other method or even in a child class! An ivar already exists: _isThreaded. But that doesn't record the same thing. The __gs_locked boolean records whether the lock is locked, not whether the animation is threaded. I agree : _gs_isLocked records whether the _local_ lock is locked. So it has to be a _local_ variable. _gs_isLocked as an ivar is an error. (...) I only looked at the code enough to fix it to compile and manage locking correctly (...) Did you run GSTest ? Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: problems compiling NSAnimation.m
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: (...) Making it an ivar *fixes* the code to work with an older compiler Making it an ivar breaks the class in thread mode. ;-) (...) Actually that's not correct ... the lock is an ivar and is *not* local to the method, so as the lock can be modified by any method, the variable to record its state similarly needs to be modified in any method where the lock is modified. The NSRecursiveLock (did you note the lock is recursive ?) is an ivar, but the [-lock] ans [-unlock] calls are local to the method. Each method that calls lock must call unlock. __gs_isLocked records if [lock] has been called : if it is then [unlock] is called before the method returns. If an other method is called before the [unlock] then your __gs_isLocked ivar is reset (in the _NSANIMATION_UNLOCK of the called method) and [unlock] is never called. (...) Did you run GSTest ? Nope. Does that now test animations? Yep. Two demos (not really 'tests'). And they run in threaded mode by default. Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: problems compiling NSAnimation.m
Nicola Pero nicola.pero at meta-innovation.com writes: (...) very confusing, because when the second declaration of c is reached, you need to be a C standard lawyer to know what happens Yes, but only a C-riminal would do such a thing ;-) (...) What about adding a macro _NSANIMATION_SETUP That sounds good and elegant. But IMHO it would be far easier to DELETE any reference to __gs_isLocked and only test _isThreaded. Unless someone can explain why i wrote such a piece of code... ;-) ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: problems compiling NSAnimation.m
Riccardo multix at ngi.it writes: Hi, trying to compile NSAnimation on older compilers is a nightmare (like gcc 2.95). I fixed some trivial stuff, but then stopped: the main problem is the _NSANIMATION_LOCK macro. Since this macro defines a variable in it, #define _NSANIMATION_LOCK \ BOOL __gs_isLocked = NO; \ if (_isThreaded) \ { \ __gs_isLocked = YES;\ NSDebugFLLog( at NSAnimationLock,\ at % at LOCK % at ,self,[NSThread currentThread]);\ [_isAnimatingLock lock];\ } it causes a hidden c99-ism everywhere. If the definition of __gs_isLocked inside the macron can be avoided or the macroitself can be avoided, I think the code would be cleaner. Ideas? Who maintains this? -Riccardo I wrote this stuff, so i guess i could help ;-) I dont know if this can be avoided : i remember i thought very hard and i did not find any other way to make this class thread-safe and reduce overhead. But i can't remember why i added __gs_isLocked... Maybe in case of isThreaded becomes false before the unlock. But it cant (AFAIK) A 'if(_isThreaded)' might be enough, both in _NSANIMATION_LOCK and _NSANIMATION_UNLOCK. Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSAnimation...
Fred Kiefer fredkiefer at gmx.de writes: Gregory John Casamento wrote: With a clean checkout and a clean install, I still get this: Compiling file set_show_service.m ... Linking tool set_show_service ... ../Source/./obj/libgnustep-gui.so: undefined reference to `nsanimation_progressMarkSorter' collect2: ld returned 1 exit status I had a look at the code and perhaps it helps to remove the static INLINE declaration for this function. Marking it as inline does surely not help, when it is only used as a function pointer. I wrote that with the hope the compiler might do some optimization here, as the function pointer is used in an inline function... I think it might be a GCC 4.1.1 bug : i just tried with mingw-gcc3.4.2 and it compiles without error. regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSAnimation...
Fred Kiefer fredkiefer at gmx.de writes: For me it looks even worse: Compiling file NSAnimation.m ... In file included from /usr/GNUstep/System/Library/Headers/GNUstepBase/GSIArray.h:138, compilation twice now, with no luck. from NSAnimation.m:53: /usr/GNUstep/System/Library/Headers/GNUstepBase/GSUnion.h:112: error: conflicting types for ‘NSAnimationProgress’ ../Headers/AppKit/NSAnimation.h:164: error: previous declaration of ‘NSAnimationProgress’ was here (...) Did you check out -base ? I made some changes in GSIArray.h I currently don't have the time to look into this. Form a quick look it is rather a problem in GSIArray than in NSAnimation. But Xavier, when you fix it, could you please also move all the inline functions from the header to the implementation file? We don't want to clutter up the environment for all the users of this header file. Ok. I use these inline in the demo : i will move them in a private header... Could you please also move over to GNUstep indentation and white space rules? It is not too hard you just need to get used to it. Is that so important ?? It actually looks pretty ;-) I will do my best. Cheers, Fred ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSAnimation...
Gregory John Casamento greg_casamento at yahoo.com writes: Xavier, I am seeing the following error when compiling: Making all for tool set_show_service... Compiling file set_show_service.m ... Linking tool set_show_service ... ../Source/./obj/libgnustep-gui.so: undefined reference to `nsanimation_progressMarkSorter' collect2: ld returned 1 exit status make[2]: *** [obj/set_show_service] Error 1 I have tried to do a clean compilation twice now, with no luck. Thanks, GJC -- Gregory Casamento Hi I just update my source tree in my linux box (was quite old...) and all is OK for me... (a brand new GNUStep installation tree :-) Did you update -base ? I guess you did... you would get more error messages ! No idea... Couls you give me more informations ? I use GCC 4.1.2 under debian Sarge. Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: NSAnimation...
Adam Fedor fedor at qwest.net writes: On Apr 8, 2007, at 10:47 AM, Xavier Glattard wrote: Could you please also move over to GNUstep indentation and white space rules? It is not too hard you just need to get used to it. Is that so important ?? It actually looks pretty I will do my best. We've had long arguments about this. It doesn't really matter what's pretty or useful or better. It just matters that it's a standard and it's consistent with all the other software in GNUstep. You may note that i did not try to convince you that I am right and you are wrong. ;-) This subject always leads to endless discusion, as does any useless subject. Code needs to be readable. **IMHO** mine is more readable than many. I will do my best. Really :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
NSAnimation...
Hello all :-) I'm still working on the NSAnimation class, but i can't understand some parts of the specs... I need your opinion. How should the array returned by [-runLoopModesForAnimating] be used ? 1) schedule one timer for each mode in the array ? (so the animation runs whatever the mode will be) 2) start the animation only if [-currentMode] is in the array ? 3) something else ? What should happen if [-runLoopModesForAnimating] is empty or contains only unknown modes ? 1) do nothing and return ? 2) immediatly call [GSAnimator -_animationEnd] and/or [NSAnimation -animatorDidStop] ? 3) wait 'duration' then stop ? 4) something else ? At end a NSRunLoop question : What is the actual difference between [-runMode:beforeDate:] and [-acceptInputForMode:beforeDate:] Which one should i use with an NSAnimation-specific runLoop ? (blocking and threaded mode) Many thnks ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Use of libobjc from gcc 4.1 with MinGW
Nicola Pero nicola.pero at meta-innovation.com writes: I don't have *any* experience in building dll And building gcc-libobjc as a dll might break some other thing... So i give up and let this task to others, even if i could not use 'native exceptions'. Why do you need gcc-libobjc for 'native exceptions' ? For esthetic reason ;-) And because i think compiler managed exceptions is an improvement over macro based exceptions. Are there any missing changes in gnustep-objc ? We could import a new fresh libobjc into gnustep-objc to get any missing changes. Why does gnustep-libobjc prevent from using native exception ? Is it a mingw issue or a 'missing change' ? Do i miss something ? I'm not sure if you can reliably throw native exceptions across DLLs though, so even that might still not work, but you may want to try and see. I guess it might depend on the exception system used by the compiler... (sjlj...?) But that needs to be tested :-) thanks :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: fast and simple array ? (NSAnimation)
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: The base library contains an extension header (GSIArray,h) which provides array management macros for fast C style arrays. It's used in various places within the coire libraries. Thanks :-) That's what i'm looking for. May i suggest some improvements ? First i think the GSUNION mechanism shouldn't be mandatory. In NSAnimation i would write : #define GSIArrayItem NSAnimationProgress for a simple array of NSAnimatinProgress float values. The code would then be more readable (no cast, no '.ext') Suggested patch (not tested) : code @@ -105,6 +105,8 @@ #defineGSI_ARRAY_TYPES GSUNION_ALL #endif +#ifndef GSIArrayItem + /* * Set up the name of the union to store array elements. */ @@ -137,6 +139,8 @@ */ #include GNUstepBase/GSUnion.h +#endif /* #ifndef GSIArrayItem */ + struct _GSIArray { GSIArrayItem *ptr; unsigned count; /code I would also add a new function. In fact i would split GSIArrayInsertionPosition : 1) the binary search 2) the 'skipping' The functions : (not tested) code static INLINE unsigned GSIArraySearch(GSIArray array, GSIArrayItem item, NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem)) { unsigned int upper = array-count; unsigned int lower = 0; unsigned int index; /* *Binary search for an item equal to the one to be inserted. *Only for sorted array ! */ for (index = upper/2; upper != lower; index = (upper+lower)/2) { NSComparisonResult comparison; comparison = (*sorter)(item, (array-ptr[index])); if (comparison == NSOrderedAscending) { upper = index; } else if (comparison == NSOrderedDescending) { lower = index + 1; } else { break; } } return index; } static INLINE unsigned GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item, NSComparisonResult (*sorter)(GSIArrayItem, GSIArrayItem)) { unsigned int index; index = GSIArraySearch(array,item,sorter); /* *Now skip past any equal items so the insertion point is AFTER any *items that are equal to the new one. */ while (index array-count (*sorter)(item, (array-ptr[index])) != NSOrderedAscending) { index++; } #ifdef GSI_ARRAY_CHECKS NSCAssert(index = array-count, NSInternalInconsistencyException); #endif return index; } /code I think these changes wouldn't break anything... But if one doesn't like them i might do without them ;-) Thanks Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Need informations about NSAnimation on MacOS
Hello :-) The NSAnimation reference page at developer.apple.com does not explain everything. As i dont have a Mac i ask for some help. 1) NSAnimation maintains an array of NSAnimationProgress (floats). [NSAnimation -progressMarks] return a NSArray. - Is this NSArray a reference to the internal array of the NSAnimation object, or a copy ? (should be a copy...) - May this array contain a NSAnimationProgress more than once ? - Is it sorted ? How ? 2) I dont understand the 3 NSAnimationCurve... - Are they linear or polynomic functions ? - what do 'slowly speeds up' and 'slows down' really mean ? Thank in advance ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Need informations about NSAnimation on MacOS
Fred Kiefer fredkiefer at gmx.de writes: Xavier Glattard wrote: 2) I dont understand the 3 NSAnimationCurve... - Are they linear or polynomic functions ? - what do 'slowly speeds up' and 'slows down' really mean ? You may think of these function as a sort of gamma corrections for the progress Slowly speeds up would just mean that your display less progress than might be suggested by the mere numbers. The more I think about it, an S-shaped gamma correction curve is the best analogy I come up with. Fred I think i understand 'gamma curve' :-) french un dessin est mieux qu'un long discours /french :-) Linear : EaseIn : EaseOut: EaseInOut: | + | + | +++ |++ |+| + | ++ | ++ | + | + |+| + | + |+| + | + | + |+| + | + |+| + | + | + | + | + | + | + | + |++ | + |+ | + | ++ |+| ++ |+|++ |+|++ +-- +-- +-- +-- Is that Ok ? But these curves may be made of straight lines, or x^2, x^3 curves. ie for EaseInOut something like : if (progress = 1/3) value = K1 * progress; if (progress 1/3 progress = 2/3) value = K2 * progress + D1; if (progress 2/3) value = K1 * progress + D2; or like : value = A*progress^3 + B*progress^2 + C*progress Thanks :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Need informations about NSAnimation on MacOS
Xavier Glattard xavier.glattard at online.fr writes: 2) I dont understand the 3 NSAnimationCurve... An other question : You can change the NSAnimationCurve while an animation is running. Does the animation _smoothly_ changes to the new curve ? Or does it 'jump' ? Thanks again :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Use of libobjc from gcc 4.1 with MinGW
Nicola Pero nicola.pero at meta-innovation.com writes: I've did that many times. gnustep-make configure script tells me : checking for custom shared objc library... /c/GNUStep/System/Library/Libraries checking whether objc has thread support... yes: checking whether we should use native ObjC exceptions... no configure: Native objective-c exceptions were requested, but the compiler configure: doesn't support them. configure: error: compiler doesn't support native objective-c exceptions ... and configure fails. Oh ... I see. You are right - it's more complicated. Your problem is that the first time you configure gnustep-make, the new libobjc is not yet installed, but gnustep-make will try compiling the ObjC snippet to check if native exceptions actually work. That will fail, but then you can't compile the new libobjc! Everything becomes clear :-) But then i should not be the only one with this problem :-\ Presumably we need a configure flag to force native-exceptions even if the compiler would seem to fail when compiling them ? (...) A working configure script in libobjc might be useful... Then enable-native-exceptions would be a libobjc option, no more a make one. Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Need informations about NSAnimation on MacOS
Nicolas Roard nicolas.roard at gmail.com writes: On 3/23/07, Xavier Glattard xavier.glattard at online.fr wrote: Xavier Glattard xavier.glattard at online.fr writes: 2) I dont understand the 3 NSAnimationCurve... An other question : You can change the NSAnimationCurve while an animation is running. Does the animation _smoothly_ changes to the new curve ? Or does it 'jump' ? smooth change, please :) I thought we were friend... ;o) imho the simplest way is probably to use a bezier curve with different control points, and change them smoothly to go from one kind of curve to the other.. Ok. New delivery date : sep-2012 ;-) I didn't think of bezier curves... that a good idea :-) But : 1) Wouldn't Bezier curves be too slow ? 2) Does MasOs use Bezier curves ? (do we care ?) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Need informations about NSAnimation on MacOS
leeg at thaesofereode.info writes: 2) I dont understand the 3 NSAnimationCurve... - Are they linear or polynomic functions ? - what do 'slowly speeds up' and 'slows down' really mean ? They're certainly polynomial, but in fact they may not fit any finite-order polynomial function (may be sinusoidal for instance). I agree with the suggestion by Nicolas that approximating a Bezier curve is a good approach. I agree :-) I had a quick look in gnustep code but i can't find any Bezier curve implementation : all the math is hidden in the low level display server/library. Any suggestion ? A well-known library that could help me ? Thanks ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Use of libobjc from gcc 4.1 with MinGW
Helge Hess helge.hess at opengroupware.org writes: On Mar 21, 2007, at 17:52, Xavier Glattard wrote: Why the hell should libobjc be build as a dll Don't know whether this was really a joke Anyways, its *very* important that libobjc is built as a DLL if you build any other ObjC library/framework/bundle as a shared object. Otherwise you end up with multiple ObjC runtimes in a single application! This has cost me a LOT of time in the past because its an easy to make mistake. Yes, this was not really a joke :-\ An other stupid question : why dont link _only_ gnustep-base to a static libobjc ? So you would not had multiple objc runtime ! Hum... i bet you can't ;-) I read many things about undefined symbols that prevent to build dll... Is that the problem ? Thanks for your patience :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
fast and simple array ? (NSAnimation)
Hi NSAnimation class needs an array of floats that may grow... (for progress marks) Is there a gnustep tool (c functions, macros,...) that manages such data efficiently ? (IMHO a NSMutableArray containing NSNumber objects would be quite slow and fat) thanks Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Use of libobjc from gcc 4.1 with MinGW
Hi I found out how to compile gnustep-base with the gcc4.1 objc library (not the gnustep one). I can now enable native exceptions :-) I had to change one line in objc-decls.h : - #if defined (_WIN32) || defined (__WIN32__) || defined (WIN32) + #if !defined(__MINGW32__) defined (_WIN32) || defined (__WIN32__) || defined (WIN32) I get the change from gnustep-libobjc. BUT i'm not sure this library is fully compatible with gnustep-libobjc. Could someone confirm that should works ? Then i will post this change to a gcc ml. Thanks :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Use of libobjc from gcc 4.1 with MinGW
Andrew Pinski pinskia at gmail.com writes: On 3/21/07, Xavier Glattard xavier.glattard at online.fr wrote: Without the change i got : So these names are not exported properly. I dont know why but mingw32 seems to be special... :-\ Is libobjc being compiled as a static library? I bet that is the real issue here. Right :-) gnustep-libobjc is build as a dll and gcc-libobjc is static. Then ? Do you mean i would get the same error with a static gnustep-libobjc ? Should I build gcc-libobjc as a dll ? Should i tell gnustep-base to link to a static lib ? How ??? ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Use of libobjc from gcc 4.1 with MinGW
Xavier Glattard xavier.glattard at online.fr writes: I found out how to compile gnustep-base with the gcc4.1 objc library (not the gnustep one). I can now enable native exceptions I had to change one line in objc-decls.h : - #if defined (_WIN32) || defined (__WIN32__) || defined (WIN32) + #if !defined(__MINGW32__) defined (_WIN32) || defined (__WIN32__) || defined (WIN32) *** Actually this change doesnt change anything *** The creation of the lingnustep-base.dll has failed silently... (I forgot to delete libgnustep-base.dll.a created in the previous attempt) This needs still more work. ...not so simple... ;-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
RE: Problem building gnustep-base tools with MinGW
Selon Nicola Pero [EMAIL PROTECTED]: Mine is: gcc -Wl,--enable-auto-import -fgnu-runtime -o obj/autogsdoc.exe ./obj/autogsdoc.o ./obj/AGSParser.o ./obj/AGSOutput.o ./obj/AGSIndex.o ./obj/AGSHtml.o -L../Source/./obj -L/home/Nico/GNUstep/Library/Libraries -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib/gnu-gnu-gnu -L/usr/local/lib -lgnustep-base-lobjc -L/usr/local/lib -lxml2 -lz -liconv -lws2_32 -liconv -lcallback -lavcall -liberty -lz -lws2_32 -ladvapi32 -lcomctl32 -luser32 -lcomdlg32 -lmpr -lnetapi32 -lm -I. With layout=fhs mine is : gcc -Wl,--enable-auto-import -fgnu-runtime -o obj/autogsdoc.exe ./obj/autogsdoc.o ./obj/AGSParser.o ./obj/AGSOutput.o ./obj/AGSIndex.o ./obj/AGSHtml.o -L../Source/./obj -L/home/Xavier/GNUstep/Library/Libraries -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib/gnu-gnu-gnu -L/usr/local/lib -L/usr/local/lib -lgnustep-base-lobjc -lxslt -L/usr/local/lib -lxml2 -L/usr/local/lib -lz -lws2_32 -liconv -lcallback -lavcall -lbfd -liberty -lz -lws2_32 -ladvapi32 -lcomctl32 -luser32 -lcomdlg32 -lmpr -lnetapi32 -lm -I. The only difference that I can see if that you have -lxslt ... could it be anything to do with the problem ? xslt is installed since a very long time... But it seems you're right !! This morning i deleted everything and re-install from scratch and now it works with gnustep-make in c:/GNUstep, with gcc 3.4.2, without xslt. (I still cant use --enable-native-objc-exceptions but that's not so important) But if i install xslt, gnustep-base doesn't build ! (i tried twice as i wanted to be sure :-) I build xslt from source without any oddity. It is installed by default in /usr/local - like any other library. And it is found by gnustep-base configure script : checking for xml2-config... /usr/local/bin/xml2-config checking for libxml - version = 2.3.0... yes checking libxml/SAX2.h usability... yes checking libxml/SAX2.h presence... yes checking for libxml/SAX2.h... yes checking for xsltApplyStylesheet in -lxslt... yes checking libxslt/xslt.h usability... yes checking libxslt/xslt.h presence... yes checking for libxslt/xslt.h... yes I still dont understand all the problems i encountered : Why the old release version couldn't be built ? I'm (almost) sure they used to. Many thanks ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
RE: make install
I dont remember i ever want to install anything in Local... I even had to add to create some links from Local/Tools to System/Tools because some apps only search in System... But i wasn't suprised because it's a standard behavior on Linux : hand build software are installed in /usr/local by default and that's fine. Well... Now i'm affraid i have to reinstall GNUstep. Thanks. Xavier Selon Nicola Pero [EMAIL PROTECTED]: Installing into System is supposed to be the standard ... ;-) If you want to always install everything into Local, you can try export GNUSTEP_INSTALLATION_DOMAIN=LOCAL in your shell (in particular, add it to your shell initialization script). :-) This will then install everything into Local/ ;-) Thanks -Original Message- From: Xavier Glattard [EMAIL PROTECTED] Sent: Thu, March 15, 2007 9:41 pm To: gnustep-dev@gnu.org Subject: make install Hi all :-) I used to use make-1.13. I just upated it to svn version. When i did 'make install' with 1.13 version all files were put in GNUstep/Local/... directory. But now they are put in GNUstep/System/... I had to clean by hand my Local directory because it is search first (by ld) and old versions of base/gui/... are found. What is the 'right' behavior ? Do i miss something ? Thanks ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
RE: Problem building gnustep-base tools with MinGW
Selon Nicola Pero [EMAIL PROTECTED]: ./configure --with-layout=fhs make make install Done. Does not work : same errors. That's surprising. :-( It seems to suggest that probably the problem is something else. :-/ Maybe it's a bug in gnustep-base then ? It looks like I'll have to reboot under Microsoft Windows and try it all again. :-/ PS: stuff like ./configure --prefix=C:/GNUstep is no longer recommended and might not work. To make things simpler, we prefer people to develop in the clean MSYS/MinGW Unix-like environment where it's guaranteed that there are *no* problems, but making sure the resulting binaries can be then shipped/distributed/organized in some other, more Windows-friendly, way. ;-) So GNUstep becomes an Unix-like environment. That's bad. Well ... GNUstep command-line development is Unix-like, but it has always been like that. Things are compiled using sh/make/gcc ... that's why you need MSYS. ;-) MSYS is only a developper tool, a command prompt with bash, and is not mandatory : you can use any mingw tools from a Windows prompt. A command you type in a MSYS box only use mingw; if you pass a 'path' as an argument to a command, MSYS bash translates it to a Window path. Just try this at MSYS prompt : (dont type the '$' ;o) $cat test.c #include stdio.h main( int argc, char**argv) { puts(argv[1]); } ^D $gcc test.c $a /usr/local I get : c:/Dev/MinGW/local If you mix Unix paths with non-Unix paths sh/make/gcc/etc get easily confused. A MinGW command never use MSYS tree. MinGw doesnt know /usr/local/GNUstep, it knows c:/MSYS/1.0/local/GNUstep So unix paths and non-unix paths are never mixed. Should i say 'always' ? hum... ;o) Problems happen with space char in file name, or with backslash Then things maybe work, maybe not, and it's difficult to get things working consistently, predictably and reliably. Which is why we really recommend working inside MSYS when building, other types of building are not really supported. That what i do :-) But once you have built your stuff, you are free to use your environment in a more Windows-like setup! :-) Even my MSYS/mingw installation is not 'standard' as i use some msys-links : / is C:\Dev\msys\1.0 /mingw is C:\Dev\MinGW\mingw /usr/local is C:\Dev\MinGW\local Should that work with GNUstep or do I have to reinstall the whole thing ? I'm not sure, I'd need to boot Windows to help you here. :-/ But if you can figure out how to use these 'links' then I imagine that you can put GNUstep wherever you want on disk ;-) Just create a link /usr/GNUstep -- C:\GNUstep MSYS links may be defined in /etc/fstab But that not mandatory : for MSYS, C:\GNUstep is always /c/GNUstep If i type : $make --prefix=/c/GNUstep make gets : --prefix=c:/GNUstep (try with the little program above) When you build anything you can see the paths that are used by gcc. All of them start with 'c:/' regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
make install
Hi all :-) I used to use make-1.13. I just upated it to svn version. When i did 'make install' with 1.13 version all files were put in GNUstep/Local/... directory. But now they are put in GNUstep/System/... I had to clean by hand my Local directory because it is search first (by ld) and old versions of base/gui/... are found. What is the 'right' behavior ? Do i miss something ? Thanks ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Call for volunteers: Backporting mySTEP changes
Selon Fred Kiefer [EMAIL PROTECTED]: Xavier Glattard wrote: Fred Kiefer fredkiefer at gmx.de writes: (...) 3. Changes to GNUstep mySTEP has a few correction and additions to methods that are already implemented in GNUstep. We should try to extract as much of these as possible. On the other hand have we fixed a lot of bugs in GNUstep since the fork. We don't want to loose these fixes. Quite often there are also two independent implementations of methods in GNUstep and mySTEP, so no benefit may be gained by merging them. This surely is the hardest case and should be done very carefully. (...) I guess NSApplication and NSRunLoop stuff are in this category. I had a quick look in myStep with a diff tool (on NSApplication and NSRunLoop)and it seems all has been rewritten... Is there anything to extract ? Or should it be better not to change anything ? I mean : is there any 'political' point of view about this part of GNUstep ? I have limited my mail to the AppKit changes of mySTEP, let Richard comment on the ones to Foundation. In AppKit we have the nice situation that most code is not OS specific, this means some of the limitations of mySTEP don't apply here. Still we need to make sure we don't break any platform. Ok. I won't bother you any more with RunLoop... Well... for some time ;o) A diff will never work to find the changes in mySTEP as Nikolaus uses a completely different formatting style and methods have been moved around a lot in both branches since the fork. It is really down to doing a one method at a time comparison. There are some differences in NSApplication. As this class is central i guess many other classes use it and then it should be treated first. A quick look in NSApplication.h shows me some additions : - an event queue (i know : i promised ;o) - global enum : NSApplicationDelegateReply, NSApplicationPrintReply - some new methods (MacOS) I'm a volunteer :-) Great, now there are two of us :-) Best you start out with the new classes I listed. They will need to get added to the GNUmakefile and the NSAppKit.h file and, what is more important, fill with code. Ok. I will work on the first one : NSAnimation. Then the next one and so on until i couldn't. Is there a good example of gnustep coding standard conformity around ? Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Call for volunteers: Backporting mySTEP changes
Fred Kiefer fredkiefer at gmx.de writes: (...) 3. Changes to GNUstep mySTEP has a few correction and additions to methods that are already implemented in GNUstep. We should try to extract as much of these as possible. On the other hand have we fixed a lot of bugs in GNUstep since the fork. We don't want to loose these fixes. Quite often there are also two independent implementations of methods in GNUstep and mySTEP, so no benefit may be gained by merging them. This surely is the hardest case and should be done very carefully. (...) I guess NSApplication and NSRunLoop stuff are in this category. I had a quick look in myStep with a diff tool (on NSApplication and NSRunLoop)and it seems all has been rewritten... Is there anything to extract ? Or should it be better not to change anything ? I mean : is there any 'political' point of view about this part of GNUstep ? I'm a volunteer :-) Xavier [ Fred: thanks for the changelog ;-) ] ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Windows backend : questions and answers
Hi I'm ready to post a 'clean' Windows backend to the repository. Few changes but i dont want to annoy some... ;-) And I have some questions. Here are the changes : - Deletion of all non-GNUstep debug stuff (printf...) - Deletion of all Notification hooks (used for a debugging purpose) - Deletion of the Application preference Panel that popups (pops up?) the 1st time you run _any_ application - rename GSWINHandlesWindowDecorations and GSWIN32HandlesWindowDecorations options to GSW32HandlesWindowDecorations (none worked because of a typo). - use of GSBackHandlesWindowDecorations option like X11 backend - all these options are read in -initWithAttribute: (no more in +inializeBackend) and set an instance (not class) variable. - add methods -handlesWindowDecorations/-setHandlesWindowDecorations - add methods -usesSystemTaskbar/-setUsesSystemTaskbar - fixing a bug in W32_GLContext (placement of GL subwindow when handlesWindowDecoration == YES) Here are some questions : - Should the backend options be handled by a SystemPreferences module ? (X11 backend options have no dedicated module) - in my patch handlesWindowDecoration (like X11?) and usesSystemTaskbar are set by default : do you agree with these choices ? - [-stylewindow::] seems not to be used, neither by X11 backend. Delete ? - GSUseWMStyles option is still present ... have to choose ? (=GSBackHandlesWindowDecorations=GSW32HandlesWindowDecorations) - i suggest to rename GSUseWMTaskbar to GSUseSystemTaskbar or anything. - does the backend runs on 64bits system ? If it does, why not rename it to MSWin or Win or MSW or something ? Thanks for your comments Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Windows backend : questions and answers
Nicola Pero nicola.pero at meta-innovation.com writes: - in my patch handlesWindowDecoration (like X11?) and usesSystemTaskbar are set by default : do you agree with these choices ? Yes but ... I expect the person who added the application preferences panel did so because people want a variety of behaviors ... so I think that removing that panel without providing a better alternative is a mistake. Unfortunately I don't know what the better alternative is. We could move it to the System Preferences application. A Windows installation system has been discussed many times here... Wouldn't it be an other good place to move this preference panel to ? The System Preferences compiles and runs on Windows, except for the 'Fonts' module which contains a category of a non-existing class (well, non-existing when the 'Fonts' module is compiled) which the compiler barfs on. It's weird : the Fonts module try to add a category to a class it has not access to : already build but defined in an application... X ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Windows backend : questions and answers
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: On 6 Mar 2007, at 09:10, Xavier Glattard wrote: (...) - Should the backend options be handled by a SystemPreferences module ? (X11 backend options have no dedicated module) In the long term, I'd like to see this stuff controlled by themes, with overrides provided by manual setting of user defaults or by setting them from a preferences app. The 'Defaults' panel already handles 'GSUseWMTaskBar' and 'GSX11HandlesWindowDecorations'. A very easy solution would be to rename the later to 'GSBackHandlesWindowDecorations'. - in my patch handlesWindowDecoration (like X11?) and usesSystemTaskbar are set by default : do you agree with these choices ? Yes but ... I expect the person who added the application preferences panel did so because people want a variety of behaviors ... so I think that removing that panel without providing a better alternative is a mistake. Unfortunately I don't know what the better alternative is. My impression of the preference panel was that it looked quite good and professional to offer the user the option first time stuff was used (though allowing setting the default for all apps as well as just one app would be an improvement). However, this should really be something done when packages are installed for the first time rather than when they are run for the first time. But since we don't have such functionality in gnustep-make, and don't have any other standard installation system, I can see why the author put it into the backend. That panel was 1) annoying 2) problematic : if you ignore it (or dont see or dont understand) the application crashes in some case (try Gorm...) Under X11 there is not such a panel and nobody complains about that. Why ? (...) - i suggest to rename GSUseWMTaskbar to GSUseSystemTaskbar or anything. Yes ... makes sense ... there may be other systems where we want to integrate with someone elses taskbar. Perhaps GSBackUsesNativeTaskbar ? I like it :-) What is the 'GSAppOwnsMiniwindow' option ? Not related ? And 'UseWindowMakerIcons ? Both are handles by the 'defaults' panel. - does the backend runs on 64bits system ? If it does, why not rename it to MSWin or Win or MSW or something ? Not yet ... afaik there is no 64bit version of mingw available yet. However, I guess 64bit windows support is likely some time in the future. Yep. MinGW is actually mingw*32*... And Cygwin dont run natively on a 64bit system. So ? Keep on with WIN32 ? I guess nobody cares ;-) ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: about RunLoop, joystick support and so on
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: (...) That's perhaps a bug ... as I understand it the code it supposed to return an X or windows event if it has already been received, and if no event has been received, call the runloop to wait for more events. As long as that is working it's fine, but if the attempt to check for an event already received also does a read to get new events, then there is indeed the problem you describe of the runloop never being called. If this is happening, it's not a bug in the runloop, just a subtle bug in the backend (in that it is failing to run the runloop when it should). Such a bug ought to be fairly easy to fix ... a crude fix would be to run the runloop once before fetching each item from the windows message queue or X event queue. No : the problem would then be moved to the runLoop : if many non gui events occur in the runLoop, gui events would never be handled. I don't follow that argument ... the gui events and non-gui events would be intermingled, so gui events would be handled. Ok, i now understand. You're right : that's crude :-) A more efficient option might be to use different calls to examine the windows/X event queues (ones that don't read in new events), or to count the events available each time the runloop signals event availability, and re-run therunloop after the count of events has been processed. IMHO the best option would be to manage all events (gui and non gui) in one place, saying the runLoop. One loop could be : - for each source of events : get one event if available (not wait) - if there is no event, wait (until a timer fires) - sort the events in a queue - return the oldest event This mechanism would need an other queue in the runLoop (or one more queue for each mode ?). May be they already exist (?) The runloop works like this ... 1. fire timers and find the ext timer in the future 2. call select()/poll() to wait for the set of all events we are interested blocking until there is an event or it's time for the next timer to fire 3. when that system call returns, call the callback methods for all the objects interested in any of the events found 4. optionally, go back to (1) So no queue is required by the runloop, it always dispatches all the available events when it is run. It can also be told to run through once without blocking ... that has the effect of firing all the timers and dispatching any events which are immediately available. A queue is needed _if_ the events have to be sorted, in a runLoop that handles _all_ events (gui and other). An other method would be to keep somewhere an index to the last source that fired an event, and it would be the last to be check the next time the runLoop is run. Looks better :-) If the runLoop would handle all events : 1. [NSApp -run] would not use [-nextEventMatching:] but simply send [runLoop -runUntilDate:] 2. [GSDisplayServer -getEventMatchingMask:...] would not run the runLoop 3. The runLoop would check the displayServer like any other sources and then any incoming event would be send to NSApp I do think that all events have to be handled at the same level, the RunLoop. That's what the spec say. And afaik they don't say that [NSApplication -nextEventMatching:] is supposed to run the loop. Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: about RunLoop, joystick support and so on
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: On 13 Feb 2007, at 19:53, Xavier Glattard wrote: I posted here some days ago more details about this opengl program. If you need more, just ask. Did you launch it ? It behaves as if the runLoop would block waiting for event from the gui while some performers or user events are waiting. Under x11 only windows with non retain backing store are faulty with 'Performers', 'EventsPerf' and 'EventsTimer' methods. I ran it on gnu/linux and it looked very good but the menu and the controls on the window stopped operating ... I haven't had time to really look at the code and figure out why. Does it hang when you click the 'Start' button ? I dont undertstand : it runs fine on my debian system (x86) An OpenGL problem ? Under w32 i just remember than the program doesnt work properly in many more cases. You can select the backing store in the menu. I tried building under win32, but failed with a lot of link errors. I'm probably missing an essential library. I will try to rebuild it from the tarball. I may have missed something. (...) The runloop uses a poll() or select() or WaitForMultipleObjects() call to perform an idle wait for *all* events the program is currently interested in. That means that it does not do a busy poll using up the CPU with repeated calls, and it does not block waiting for a single event source, preventing other events from being received. We agree :-) The diagram was a simplification of what it should actually be done. I've just put in a column all the messages that might be sent. And i understand than it would be difficult to include in the run loop a 'watcher' that can't be 'selected'. Such an input source have to be tested periodically : - start loop - select other sources for some 1/1[000] of a second - test the 'unselectable' source(s) - loop So the is not busy all the time. It wakes up some time to time then goes back to sleep. (...) From the point of view of the main public API it's in the NSApplication instance and is accessible using NSApplication methods like -nextEventMatchingMask:untilDate:inMode:dequeue: which have certain implications such as the ability to extract events from within the queue rather than just from the end. The characteristics that the queue has to have (picking items out of the queue rather than just from the front, and accessing items in the queue without necessarily removing them from it) are not those typical of a stream. You're right. Streams may not be the right way to manage an event queue. And for the moment i dont see a better way... Watchers might not be so bad, after all ;o) I've just found this : http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFRunLoops/index.html I didn't read all but this might be the API you are waiting for ;-) One problem is that the different queues (gui events, performers, socket events...) are not handled by one only object. When GSDisplay is asked for an event by the NSApp it returns one from its queue or, if none is available, calls the runLoop. So the runLoop doesn't manage the gui event queue and so has not all the cards. That's perhaps a bug ... as I understand it the code it supposed to return an X or windows event if it has already been received, and if no event has been received, call the runloop to wait for more events. As long as that is working it's fine, but if the attempt to check for an event already received also does a read to get new events, then there is indeed the problem you describe of the runloop never being called. If this is happening, it's not a bug in the runloop, just a subtle bug in the backend (in that it is failing to run the runloop when it should). Such a bug ought to be fairly easy to fix ... a crude fix would be to run the runloop once before fetching each item from the windows message queue or X event queue. No : the problem would then be moved to the runLoop : if many non gui events occur in the runLoop, gui events would never be handled. A more efficient option might be to use different calls to examine the windows/X event queues (ones that don't read in new events), or to count the events available each time the runloop signals event availability, and re-run therunloop after the count of events has been processed. IMHO the best option would be to manage all events (gui and non gui) in one place, saying the runLoop. One loop could be : - for each source of events : get one event if available (not wait) - if there is no event, wait (until a timer fires) - sort the events in a queue - return the oldest event This mechanism would need an other queue in the runLoop (or one more queue for each mode ?). May be they already exist (?) I thought of NSStream as a way to include gui event management in the runLoop, at the same level
Re: Playing with Gears
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: I made some time to play about a bit with your Gars app ... http:// amstradstuff.free.fr/GNUstep/gnustep-gears-1.0.tar.gz What did you have to change ? This is a really nice demo application, very impressive. Thanks :-) Looks like you spend many time to test this toy. Your comments are very interesting. But they're not what i was expected ! Some observations on the options provided for animating. 1. pure timer based animation... the repeat interval set for the timer is 0.0 seconds. I got this idea in a mac game programing forum. So this mechanism is actually used. But it works perfectily on my linux box ! With any backing store. The animation is stopped when i keep a mouse button down. That's all. That doesnt prevent the runLoop to be run... -- only 1300 FPS with buffered/retained backing store -- 2100 FPS with a non retained backing store !! the fastest 2. performer based animation On my system a perfomer based animation works perfectly, but in a window with a non retained backing store. Even if i keep a mouse button down. In a non retained window the animation is as you say : i have to move the mouse over the window to see the animation. -- 1600 FPS : faster than timers !!! 3. event based animation On my system this animation routine stops any other task (autodisplay...) But as the events are post _to_the_end_ of the queue (atStart:NO) other events are still handled (mouse clicks on menu or button) -- 1300 FPS with buffered/retained backing store -- near 2000 FPS with a non retained backing store I haven't looked at all at the implementation at the events+performer or events+timer options. Just hacks to make a event based animation running (remember : it doesnt ;-) In the 1st case, a performer is used every 0.25 sec instead of the event. The runLoop is then run once. In the second case a timer fires every 0.25 second while an event is not post. Don't work with a non retained backing store. Humm... all this is really strange... Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Playing with Gears
Fred Kiefer fredkiefer at gmx.de writes: I just gave gear a try under MacOSX and it works wonderful. All I needed to change was replace GL/gl.h with OpenGL/gl.h and include the GNustep macros from GNUstep.h. Marvellous how portable applications can be. Very impressive. I like GNUstep :-) All three animation models (or rather all five, as combinations are implemented as well) work on Cocoa. Performer is rather slow, when there a no new events generated and the others stop to work as soon as you open up the menu. But the menu works in all cases, so there is a difference to the GNUstep implementation. Great example! Fred The performer based animation is faster than timers on my system... Did you try different backing store types ? Did you try to activate autodisplay ? Thanks Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: about RunLoop, joystick support and so on
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: On 11 Feb 2007, at 19:18, Xavier Glattard wrote: (...) No, in fact both backends use the runloop and both use GSRunLoopWatcher which works perfectly. The fact that both backends at certain points chose to poll their respective message queues without asking the runloop to tell them whether there is anything available does not imply anything about You're right : it works ! Well... most of the time. GNUstep is not perfect. For instance it can't manage properly a intensive use of performers or events, neither w32 nor x11 (see my openGL test tool). I had to read the code many times to get an idea of how it works. And finally I wonder *why* it works ! ;-) As Fred says Win32 backend code is actually very strange. The X11 backend is far better (cleaner) but needs some work. And the shared code could be improved. (...) Actually I'm *hoping* that Apple will release something to specify clearly how an NSStream subclass (other than those subclasses Apple provide of course) can be tied in to an NSRunLoop. Such an API would be able to take the place of GSRunLoopWatcher. Without that API you can't write new subclasses of NSStream and get their event handing code called when an event becomes available, you can only base code on existing NSStream implementations. All you have to do to subclass NSStream is at Apple: look at NSStream, NSOutputStream ans NSInputStream reference pages. eg. if your joystick driver provides an interface like a file (normal on unix and quite common on windows) then you can probably just open an input stream using the relevant file device, but if the joystick has to be accessed signals or shared memory then you have to use the GSRunLoopWatcher api directly. I would have to subclass NSInputStream to tell it to get the data from the memory/signal/system call instead of a file. That's all. What does a GSRLWatcher that a NSStream doesnt ? The only difference I see is that GWRLWatcher handles _blocks_ of bytes while NSStream handles _streams_ of bytes. (...) Something like that : |-- GSWin32EventStream GSBackendEventStream NSInputStream --| |-- GSX11EventStream GSBackendEventStream [GSDisplayServer -eventStream] would be called by NSApp to get a NSInputStreamGSBackendEventStream. Then NSApp would register itself as the delegate of this NSStream and schedule it in the runLoop. A GSX11EventStream would get the event with XPending/XNextEvent when the runLoop polls, then translate it into a NSEvent and send it back to the loop. A GSWin32EventStream would get the event from another NSStream (which would only select the window message from PeekMessage), then translate and send it back to the loop. Not so simple ? Yeah probably That sounds quite nice, Thanks :o) but basically it's reorganising the incoming half of the GSDisplayServer so that instead of adding events to the application's event queue directly, it provides a stream of NSEvent objects for the application to put in the event queue itsself. In both cases the internal workings would need to be pretty much the same ... 1. ask the runloop to inform the GSDisplayServer instance when there is data available No : the NSApp needs the data. The server knows if data is available. 2. when data is available, pull it off the X event queue or windows message queue No : the server pull off the event and give it when asked 3. make sense of the data, generating the corresponding NSEvent object or objects (if any) Yes. 4. add the event to the event queue (current implementation) or store the event in memory owned by a stream object and trigger an event handler in the NSApplication code so that the NSApplication can read the event from the stream and put it in the event queue. Yes and no : NSApp needs no event queue. If different sources of NSEvents were going to be used by lots of different pieces of code, the encapsulation of all the work inside a stream interface would be really useful/clean/simple. However, in practice we have a single source of events for a display server, and all those events go into the application's event queue and are pulled out of that queue by the code which needs the events, But the application has to handle many other events than those get from the GUI : timers and performers. And socket/network messages, and so on. and this model of operation is inherent in the AppKit/GUI API. So I don't think wrapping events in an NSStream subclass before putting them in the event queue is any help. NSStream is only a better GSWatcher. That's not the main problem. The integration of NSStream in the NSRunLoop code might be a good opportunity to make some other changes and simplifications in the event management code. Here is my 2cts suggestion. At least i
Re: about RunLoop, joystick support and so on
Fred Kiefer fredkiefer at gmx.de writes: Xavier Glattard schrieb: Another oddity of the win32 backend is the use of a good old window procedure. So the events are dispatched twice : first by some calls to DispatchMessage (always to the same window procedure) and then by NSApplication. I'm sure there is a good reason for that but i can't see it. Not sure, if I understand you correctly here. As far as I understand we always need a window procedure or is it now possible to do without one? This, or rather the method windowEventProc:, does decode the window message, depending on its category and builds up an NSEvent that then gets dispatched by NSApplication to the corresponding window. I don't see any duplication here, am I missing your point? Do you mean, we should get rid of the call to DispatchMessage? Yes, that's what i mean. Not 'should' but 'could'. Realy not important. ;-) As far as I remember from my old windows programming days, this used to be a bad idea. You never know what magic Microsoft is applying in the background to allow all the different hooks the system offers. And what would be the benefit of bypassing this call? Performance tweak ;-) I dont know many of Windows programming (i dont know many of anything). You're probably right : you never know what Microsoft is doing... As i says in my answer to Richard : At least i think the DispathMessage/windowProcedure should be hidden in a more abstract mechanism. Without the window procedure the win32 backend would be more like the x11 one, and with enough abstraction (that NSStream might gives) some more code could be shared. Could you just give an example of what you want to change here? And explain, why this would be better than the current code. In the current Windows backend there are already some cases where the NSApplication event dispatching is bypassed. I don't like this idea, but as I am not using the Windows backend, I am able to just ignore it. There is more stuff there that is clearly wrong, like overriding methods on NSMenu and NSWindow. To me it looks like somebody with very specific requirements as able to shape the Windows backend code to these requirements, but none of this is my business. I didn't look so far in the code... It's frightenning! It really needs to be rewritten... :-\ I like what you write about the changes in the run loop handling, but Richard will be the one more familiar with that. Thanks :-) You would find some ideas my answer to Richard. Cheers, Fred Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: about RunLoop, joystick support and so on
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: On 13 Feb 2007, at 11:03, Xavier Glattard wrote: Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: On 11 Feb 2007, at 19:18, Xavier Glattard wrote: (...) No, in fact both backends use the runloop and both use GSRunLoopWatcher which works perfectly. The fact that both backends at certain points chose to poll their respective message queues without asking the runloop to tell them whether there is anything available does not imply anything about You're right : it works ! Well... most of the time. GNUstep is not perfect. For instance it can't manage properly a intensive use of performers or events, neither w32 nor x11 (see my openGL test tool). I would need more details to know what you mean here. it may be that what you are seeing as a problem is actually a misunderstanding about what the code is supposed to do. I posted here some days ago more details about this opengl program. If you need more, just ask. Did you launch it ? It behaves as if the runLoop would block waiting for event from the gui while some performers or user events are waiting. Under x11 only windows with non retain backing store are faulty with 'Performers', 'EventsPerf' and 'EventsTimer' methods. Under w32 i just remember than the program doesnt work properly in many more cases. You can select the backing store in the menu. Actually I'm *hoping* that Apple will release something to specify clearly how an NSStream subclass (other than those subclasses Apple provide of course) can be tied in to an NSRunLoop. Such an API would be able to take the place of GSRunLoopWatcher. Without that API you can't write new subclasses of NSStream and get their event handing code called when an event becomes available, you can only base code on existing NSStream implementations. All you have to do to subclass NSStream is at Apple: look at NSStream, NSOutputStream ans NSInputStream reference pages. I was talking about how to get it to interact with an NSRunLoop effectively ... ie how to get a runloop to trigger an event on the stream when the low level operating system event occurs. eg. how do you set things up to trigger a stream event when a semaphore flips or a shared memory segment is updated. Ok. I understand : something like a 'select' that works on NSStream. That would be handy :-) (...) What does a GSRLWatcher that a NSStream doesnt ? On windows ... windows messages. Yeah ! And on X11... X11 messages :-) The only difference I see is that GWRLWatcher handles _blocks_ of bytes while NSStream handles _streams_ of bytes. No, a watcher does not handle bytes at all. It detects whether an event has occurred (eg a file descriptor becoming readable) and informs its delegate so that the delegate can handle any data transfer. But it does handle data under w32 since it returns the message as the 'extra' argument of receivedEvent. Another weird behavior of the w32 backend... (...) What you seem to be describing here is either a blocking or an actively polling model ... the app asks the server for an event, the server checks the windows or X queue and if there is an event, parses and returns it. If there is NOT an event, then either 1. (polling) a nil event is returned and the app asks again or 2. (blocking) the server waits until an event arrives, then returns that Is there an other way ? That what the runLoop does : polls/selects for a limited period of time, until a timer has to be fired. (...) If you look at the API and documentation you will find that it *has* an event queue. Sure, the whole system could be designed and implemented differently, but that's what the design of the OpenStep/ MacOS-X/GNUstep AppKit/GUI library happens to be. I can't see any event _in_ the NSApplication. NSApp gets events from a queue, post event to a queue, but we dont know where is this queue. I think it should be in the server. And it is! If different sources of NSEvents were going to be used by lots of different pieces of code, the encapsulation of all the work inside a stream interface would be really useful/clean/simple. However, in practice we have a single source of events for a display server, and all those events go into the application's event queue and are pulled out of that queue by the code which needs the events, But the application has to handle many other events than those get from the GUI : timers and performers. And socket/network messages, and so on. I thought we were taking about gui events (NSEvent objects). Certainly we handle other events via callbacks from the runloop too ... but they are not connected to the issue of handling the NSEvens in a stream subclass. One problem is that the different queues (gui events, performers, socket events...) are not handled by one only object. When GSDisplay
Re: about RunLoop, joystick support and so on
Fred Kiefer fredkiefer at gmx.de writes: Richard Frith-Macdonald schrieb: On 9 Feb 2007, at 17:55, Xavier Glattard wrote: phew ! My brain boiled three times (and fried twice) before i understand anything... And many pieces of code are still quite obscure to me. I would not be a very good compiler. But i found out what you talk about. Where you see a performance tweak I see... hum... In french i would said 'un sac de noeuds' (bag of knots) Well, I'm not sure (would probably need to find the author of that bit of code and ask them), but I can't see any other reason for bypassing the run loop like that. I *think* all the calls to the 'calback' method could probably be commented out. As I was the original author of the GNUstep Windows backend code I had a quick look myself. Much has changed here since I last looked at this code, but the callback: method seems to have stayed mostly the same. Which of course is bad, when everything around it has changed. When I originally wrote that code there wasn't much support for Windows message loops in base and not much of it in Cygwin or MinGW. What I implemented at that time as direct polling for messages, the code would ask windows from time to time, if new messages for the application where available. This was a horrible hack, but the best I could do at that time. Later on we added the handling for the Cygwin special file /dev/windows and then the code for Windows message handling in base was improved. All of this made the callback: method in back obsolete, but somehow this was missed out by the programmers doing these local changes. It is great that it finally has been noticed by you. This could lead to some simplifications in the code of Win32Server. And while we are at that, why not clean up the code for the different implementations of GSRunLoopCtxt as well? To me it looks like there is quite a lot of duplication going on here, which might be reduced by using subclasses, but then, what do I know about that... Fred The state of this code is typically due to many changes by many developpers... If ones need a proof that GNUstep is opensource, here it is ;-) Another oddity of the win32 backend is the use of a good old window procedure. So the events are dispatched twice : first by some calls to DispatchMessage (always to the same window procedure) and then by NSApplication. I'm sure there is a good reason for that but i can't see it. As we talk about runLoop and backend you should have a look at XGServerEvent in the X11 backend. The server registers itself in the runLoop but -receivedEvent doen't use its arguments and pick the event right from X11 with XPending/XNextEvent (is there an other way to get x11 events ?). Moreover -receivedEvent is called many times from inside the server with null arguments (does -receivedEvent really called by the runLoop ?). Sounds weird ? AFA I understand the backend doesn't use the runLoop the way it should, neither win32 neither x11. It looks like the implementation of the use of GSRunLoopWatcher as never been achieved. Richard tells Apple is working on a new runLoop mechanism. IMHO rewrite a backend based on GSRunLoopWatcher or only rewrite GSRunLoopWatcher implementation (if you really plan to switch to an Apple compatible mechanism later) would be a waste of time. According to Apple site NSStream is part of Cocoa Foundations since MacOS X 10.3 and has not been updated since 2006-05-23. I think of a backend event interface based on NSStream. NSStream would be modified later to use the successor of GSRunLoopWatcher (or nothing : it seems to me that NSStream and GSRunLoopWatcher do the same job). Something like that : |-- GSWin32EventStream GSBackendEventStream NSInputStream --| |-- GSX11EventStream GSBackendEventStream [GSDisplayServer -eventStream] would be called by NSApp to get a NSInputStreamGSBackendEventStream. Then NSApp would register itself as the delegate of this NSStream and schedule it in the runLoop. A GSX11EventStream would get the event with XPending/XNextEvent when the runLoop polls, then translate it into a NSEvent and send it back to the loop. A GSWin32EventStream would get the event from another NSStream (which would only select the window message from PeekMessage), then translate and send it back to the loop. Not so simple ? Yeah probably ;-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
about RunLoop, joystick support and so on
Hi all I try to understand NSRunLoop and event management. I have found the following text in NSRunLoop.h It's about GSRunLoopWatcher * The following interface is not yet deprecated, * but may be deprecated in the next release and * removed thereafter. * * The run loop watcher API was originally intended to perform two * tasks ... * 1. provide the most efficient API reasonably possible to integrate * unix networking code into the runloop. * 2. provide a standard mechanism to allow people to contribute * code to add new I/O mechanisms to GNUstep (OpenStep didn't allow this). * It succeeded in 1, and partially succeeded in 2 (adding support * for the win32 API). * * However, several years on, CPU's are even faster with respect to I/O * and the performance issue is less significant, and Apple have provided * the NSStream API which allows yoiu to write stream subclasses and add * them to the run loop. * * We are likely to follow Apple for compatibility, and restructure code * using NSStream, at which point this API will be redundant. What is the status of GSRunLoopWatcher ? Why is it not use in backend ? (under win32, PeekMessage/DispatchMessage are called firth by the DisplayServer then by GSRunLoopCtxt) Is there an other mechanism on the way ? If i want to add joystick support to GNUstep, which interface do i have to use ? Many thanks :-) Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: OpenGL and MS Windows : done
xavier.glattard at free.fr writes: Here is a patch to GS backend. http://amstradstuff.free.fr/GNUstep/back-Win32GL-070130.patch.gz http://amstradstuff.free.fr/GNUstep/back-Win32GL-070130.new.tar.gz You can now use NSOpenGLView under MS Windows Ooops... :-\ If ever you try this patch you would find out that you have to define HAVE_WGL. My working copy use an configure.ac file i modified some weeks ago when i was working on Cairo/Glitz backend (see a previous post). It defines HAVE_WGL for me. As i still cant submit any change to the repository (soon?) i post here a diff: http://amstradstuff.free.fr/GNUstep/back-configure.ac-070203.diff It also checks for Glitz, Glitz over glx, Glitz over wgl, and Cairo over Glitz. I guess you may only get the ''WGL support'' part and some lines near the end begining with 'if test $BUILD_SERVER = win32;' Sorry for the inconvenience... if anyone uses this work. Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: OpenGL and MS Windows : done
Richard Frith-Macdonald richard at tiptree.demon.co.uk writes: On 30 Jan 2007, at 18:01, xavier.glattard at free.fr wrote: Hi all Here is a patch to GS backend. http://amstradstuff.free.fr/GNUstep/back-Win32GL-070130.patch.gz http://amstradstuff.free.fr/GNUstep/back-Win32GL-070130.new.tar.gz You can now use NSOpenGLView under MS Windows It's based upon the X11 code, it doesnt do more (actually less!) and has not been fully tested, but it works with my Gears toy (http://amstradstuff.free.fr/GNUstep/gnustep-gears-1.0.tar.gz) Thanks very much. I applied your patch. It still needs some work. More to come :-) If you have time, you might help me to answer some questions about the differences between Gears under X11 ans Gears under Windows. Probably some RunLoop and event management issues that i'd be pleased to get solved. (you might need a linux box and a windows box...) I can try ... but most likely we would need some really tiny sample program to demonstrate any oddities, so we could run under debug. Gears is quite tiny. Build it, run it and try as many configurations you want with the gui. Under Windows you might have to change LDFLAGS in the make file so it can find OpenGL libraries. Then you should read some parts of the file GearsAnimator.m (you can ignore the other files). It defines 5 small *Animator classes that use either events, performers or timers to run the animation loop. Each class basically uses its own [-_animation{Begin,Loop,End}] methods and some other utility methods that send/receive events, start/stop timers, send/receive perfomers. /-- TimerBasedAnimator | Animator --|-- PerformerBasedAnimator (abstract) | /-- EventAndPerformerBasedAnimator \-- EventBasedAnimator --| \-- EventAndTimerBasedAnimator The TimerbasedAnimator class uses 3 class methods needed to manage 2 or more timer based animation loops (using Notifications). They can be ignored. When an EventBasedAnimator is running the NSApplication loop can't handle timers, performers and autodisplay because events are always handled first (under X11). The EventAnd*BasedAnimator classes are hacks : they have been written to give time to the NSApplication loop to perform other task every 1/4 second. IMHO this tool might help you gnustep developpers to explore and understand the NSApplication loop on various platforms. Thank for your help Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
OpenGL and MS Windows : done ;-)
Hi all Here is a patch to GS backend. http://amstradstuff.free.fr/GNUstep/back-Win32GL-070130.patch.gz http://amstradstuff.free.fr/GNUstep/back-Win32GL-070130.new.tar.gz You can now use NSOpenGLView under MS Windows It's based upon the X11 code, it doesnt do more (actually less!) and has not been fully tested, but it works with my Gears toy (http://amstradstuff.free.fr/GNUstep/gnustep-gears-1.0.tar.gz) If you have time, you might help me to answer some questions about the differences between Gears under X11 ans Gears under Windows. Probably some RunLoop and event management issues that i'd be pleased to get solved. (you might need a linux box and a windows box...) Any spare guru around ? ;o) Thanks Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Error in [back] XGGLContext.m ???
Hello I'm playing with NSOpenGLView (only with code : no Gorm) and my custom GLView is always shifted up- and rigth- ward, and it seems the amount of pixels depends on the window decoration (ie not the same with or without NSResizableWindowMask). I got it fixed by changing line #83 in back/Source/x11/XGGLContext.m, in [XGXSubWindow-initWithView:] win_info = [XGServer _windowWithTag: [win windowNumber]]; NSAssert(win_info, NSInternalInconsistencyException); - rect = [view convertRect: [view bounds] toView: nil]; + rect = [view convertRect: [view bounds] toView: [[view window]contentView]]; I'm not sure that's the good way to fix that bug, and i'm not even sure it's really a bug or an error in my own code... Why is an NSOpenGLView in Gorm ok As i was looking around i find a weird line #1423 in gui/Source/NSView.m, in static NSRect convert_rect_using_matrices(...) for (i = 0; i 4; i++) p[i] = aRect.origin; p[1].x += aRect.size.width; - p[2].y += aRect.size.height; + p[1].y += aRect.size.height; p[3].x += aRect.size.width; p[3].y += aRect.size.height; A typo ? Still not sure... Hope this could help. Regards xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Win32 Cairo backend...
Hi! Selon Fred Kiefer [EMAIL PROTECTED]: [EMAIL PROTECTED] schrieb: I've started to work on the win32 Cairo backend (winlib and glitz) (...) (...) Just to warn you: I plan to do a big rework of the GNUstep cairo backend, in the hope to get scrolling to work. If you have any changes to the backend yourself, feel free to forward them to me. Cheers, Fred There is a far better patch than the one i posted some days ago : http://amstradstuff.free.fr/GNUstep/back-070105.patch.gz (based upon rev 24314) New files : http://amstradstuff.free.fr/GNUstep/back-070105.new.tar.gz to be expanded in base/trunk - Changes in config system seem to be ok : you should take it ! tested on mingw and linux/debian with xlib, winlib, cairo and glitz-cairo backend configure is not included - Little change in */cairo, but some new files : Source/cairo/CairoSurface.m manages Win32*Surface classes (compile time... need some re-writting ?) */cairo/Win32Cairo* files dont really work : i get some windows, then some cairo out of memory error messages. Cant move or resize a window (out of memory). I dont understand... */cairo/Win32GlitzCairo* files dont work at all ! but glitz is also broken under x11 (?) If these could help... :-) Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Win32 Cairo backend...
to be expanded in base/trunk ERRATUM : to be expanded in back/trunk :-\ Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Win32 Cairo backend : strange behavior...
Hello You are so right !! :-) I had to install the svn version of base and gui. No more crash :-) I dont understand why my backend was compile against the svn gui (012), not the installed gui (010)... Thanks ! I'm now working on these black windows... Xavier Selon Adam Fedor [EMAIL PROTECTED]: Also, possibly a header conflict (two conflicting headers for the same library). (...) You need to set the GSBackend name to just 'GlitzCairo'. The gui searches for the matching version number by appending the gui version number to the GSBackend name. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Win32 Cairo backend : strange behavior...
Hello I've started to work on the win32 Cairo backend (winlib and glitz) I get prety (almost) black windows : Calculator and Gorm start and run :-) Well... when i'm lucky... In fact i need to insert some NSLog in my code _to_avoid_Gorm_crash_ !! These NSLog have to be at the right place, or Calculator fails to create windows (Cairo-glitz only - Cairo-winlib seems to be ok (but with black windows)) Any suggestions ? Thanks !! Last question : is the X11 (glitz) Cairo backend usable ? Thks. Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: Win32 Cairo backend : strange behavior...
Selon David Wetzel [EMAIL PROTECTED]: Xavier wrote: In fact i need to insert some NSLog in my code to avoid Gorm crash !! These NSLog have to be at the right place, or Calculator fails to create windows did you try to run your app in gdb? setting a break point on [NSException raise] helps usually. Backtrace is also a helpful tool. dave I didn't try to run Gorm in gdb because sometimes it runs fine ! An other weird behavior : if i uncomment an other NSLog (always in the same Win32CairoGlitzSurface method) i get a glitz error 'couldn't find ARGB32 surface format' (glitz_find_standard_format) _before_ the execution of the new NSLog (but at the 2nd invocation of the method). I dont understand how a std output can corrupt a program or change the result of an opengl(glitz) call. IMHO the reason of all this is either : - a gcc 4.1 bug - a mingw bug - a video driver bug - a wrong library configuration - a thread conflict - another weird thing i cant understand Here is a try with gdb in a case where Gorm cant start and ends with 'couldn't find ARGB32 surface format' (exit 1). See a full backtrace below - i dont understand anything :o\ The call came from ntdll.dll, from atioglxx.dll, from libglitz-1.exe, from ntdll.dll, from atioglxx.dll, from -[NSTableView highlightSelectionInClipRect:] But first gdb gives a warning : warning: HEAP[Gorm.exe]: warning: Invalid Address specified to RtlReAllocateHeap( 003D, 014C53A0 ) My gdb seems buggy :-\ I see a call to 'ntdll!RtlFreeThreadActivationContextStack' Could it be a thread conflict error ? Gorm GSBackend is default to 'GlitzCairo-012', that's the name of my backend. But each time i launch Gorm, i get : 'Did not find correct version of backend, falling back to std.' I dont know what that means. Could it be the reason ? Same message with Calculator or GFractal examples (the last is very very sloowww) Any ideas ? Thanks :-) Xavier - Program received signal SIGTRAP, Trace/breakpoint trap. 0x7c911231 in ntdll!DbgUiConnectToDbg () from ntdll.dll warning: HEAP[Gorm.exe]: warning: Invalid Address specified to RtlReAllocateHeap( 003D, 014C53A0 ) bt #0 0x7c911231 in ntdll!DbgUiConnectToDbg () from ntdll.dll #1 0x7c97c943 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #2 0x0022f4bc in ?? () #3 0x7c97cd80 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #4 0x014c5398 in ?? () #5 0x003d in ?? () #6 0x014c53a0 in ?? () #7 0x0022f558 in ?? () #8 0x7c97da4e in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #9 0x003d in ?? () #10 0x014c5398 in ?? () #11 0x7c97dd74 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #12 0x003d in ?? () #13 0x014c53a0 in ?? () #14 0x4060 in ?? () #15 0x0c3f5fd0 in ?? () #16 0x003d in ?? () #17 0x002c in ?? () #18 0x0009 in ?? () #19 0x0022f520 in ?? () #20 0x7c97cde9 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #21 0x003d in ?? () #22 0x in ?? () from #23 0x0c6240c8 in ?? () #24 0x003d in ?? () #25 0x0c624090 in ?? () #26 0x0022f5a8 in ?? () #27 0x7c91ee18 in strchr () from ntdll.dll #28 0x7c927bb8 in ntdll!RtlRealPredecessor () from ntdll.dll #29 0x in ?? () from #30 0x003d in ?? () #31 0x in ?? () from #32 0x04a0 in ?? () #33 0x003d in ?? () #34 0x003d0608 in ?? () #35 0x7c97dd25 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #36 0x014c5398 in ?? () #37 0x0c624090 in ?? () #38 0x in ?? () from #39 0x0169 in ?? () #40 0x0022f4d0 in ?? () #41 0x7c9206eb in ntdll!RtlAppendStringToString () from ntdll.dll #42 0x0022f730 in ?? () #43 0x7c91ee18 in strchr () from ntdll.dll #44 0x7c97dd48 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #45 0x0001 in ?? () #46 0x0022f740 in ?? () #47 0x7c95c651 in ntdll!RtlInsertElementGenericTableAvl () from ntdll.dll #48 0x003d in ?? () #49 0x5161 in ?? () #50 0x014c53a0 in ?? () #51 0x0488 in ?? () #52 0x in ?? () from #53 0x014c53a0 in ?? () #54 0x0488 in ?? () #55 0x0022f5f0 in ?? () #56 0x0048 in ?? () #57 0x003d in ?? () #58 0x0c2e1dd0 in ?? () #59 0x0c6240c8 in ?? () #60 0x0c624088 in ?? () #61 0x0c3f in ?? () #62 0x0c624090 in ?? () #63 0x0140 in ?? () #64 0x0022f530 in ?? () #65 0x01010102 in ?? () #66 0x0022f790 in ?? () #67 0x7c91ee18 in strchr () from ntdll.dll #68 0x7c97dd48 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #69 0x in ?? () #70 0x7c97dd25 in ntdll!RtlpNtMakeTemporaryKey () from ntdll.dll #71 0x7c95c651 in ntdll!RtlInsertElementGenericTableAvl () from ntdll.dll #72 0x003d in ?? () #73 0x5161 in ?? () #74 0x0c624090 in ?? () #75 0x7c927bb0 in ntdll!RtlRealPredecessor () from ntdll.dll #76 0x in ?? () from #77 0x0c624090 in ?? () #78 0x0030 in ?? () #79 0x4060 in ?? () #80 0x0c40 in ?? () #81 0x0022f7dc in ?? () #82 0x in ?? () from #83 0x0c551e28 in ?? () #84 0x018f3f40 in ?? () #85 0x692c30fe in atiPPHSN () from C:\WINDOWS\system32\atioglxx.dll #86
Re: Win32 Cairo backend : strange behavior...
Selon Fred Kiefer [EMAIL PROTECTED]: [EMAIL PROTECTED] schrieb: I've started to work on the win32 Cairo backend (winlib and glitz) I get prety (almost) black windows : Calculator and Gorm start and run :-) Well... when i'm lucky... In fact i need to insert some NSLog in my code _to_avoid_Gorm_crash_ !! These NSLog have to be at the right place, or Calculator fails to create windows (Cairo-glitz only - Cairo-winlib seems to be ok (but with black windows)) Any suggestions ? Thanks !! Last question : is the X11 (glitz) Cairo backend usable ? Thks. Not sure if anybody ever did use this. For me glitz is not working, as my glitz release seems to be too old. Just to warn you: I plan to do a big rework of the GNUstep cairo backend, in the hope to get scrolling to work. If you have any changes to the backend yourself, feel free to forward them to me. Cheers, Fred You may get a patch here : http://amstradstuff.free.fr/GNUstep/back-061222.patch - Changes in config system seem to be ok : glitz-wgl and cairo over win32 configure is included but is generated from config.in - Little change in */cairo, but some new files : */cairo/Win32* files dont really work (as you know...) - A change in Tools/win32pbs.m but it might be a problem on my side. All this needs a lot of testing Regards Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Cairo-glitz
Hello I'm browsing the SVN repository and i've just found this comment by hansfbaier on /back/trunk/Source/cairo/XGCairoGlitzSurface.m : fixed glitz api change (but does not work, because I don't know how to retrieve a proper VisualID for the display) I guess it's about this piece of code : dformat = glitz_glx_find_drawable_format_for_visual( GSWINDEVICE-display, GSWINDEVICE-screen, // GLITZ_FORMAT_DOUBLEBUFFER_MASK, // templ, DefaultVisual(GSWINDEVICE-display, GSWINDEVICE-screen) ); // FIXME: this does not work I suggest : DefaultVisual(GSWINDEVICE-display, GSWINDEVICE-screen)-visualid I hope this could help. regards Xavier PS : what about a win32-cairo backend ? or a win32-cairo-glitz backend ? thks ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: question to backend/gui guru...
Selon Philippe C.D. Robert [EMAIL PROTECTED]: What are you actually trying to come up with? And what AppKit classes would you need exactly in your code? SDL already gives you a lot of this functionality you mention. So it might be easier to just use gnustep-base + SDL for what you have in mind? This is straight forward today, when I did it years ago I had to cleanup the SDL source first, removing all the variables called 'id' ;-) -Phil -- Philippe C.D. Robert http://www.nice.ch/~phip Philippe, Some of the classes i might use : (picked up from www.gnustep.org/resources/documentation/Developer/Gui/Reference/) NSColor* NSCursor NSEvent NSFileWrapper NSFont*, NSGlyph* NSImage* NSGraphicsContext NSOpenGL* NSResponder NSScreen NSSound At least NSResponder and NSEvent will be very useful. Yes, I can do all this with SDL. But as i said i prefer reuse what i can and write code that may be easily reused in a full-gnustep apps. The SDL headers are quite clean : - one id in SDL_cdrom.h : i dont need it for the moment and i might wrap it easily - many more in SDL_openGL.h that mainly come from glext.h : i will use the real hearders but no glext (later?) Rgrds Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev
question to backend/gui guru...
Hello I intend to write a SDL+OpenGL application based on gnustep. I can use gnustep-base without problem, but i'd like to use some parts of gnustep-gui (event management, ...) without any graphic or window class/function. SDL dont provides any graphic function, and I dont want to write à full SDL+OpenGL backend !! I dont want to rewrite gnustep in any way. I only want to compile the classes i need in gnustep-gui. But I understand I would have to write a partial backend, a SDL-server, like win32 or X11 ones (i hope i can do that...) I wonder if it would be easy (or at least feasible) to split/compile gnustep-back and gnustep-gui in two parts : server and system on one side, and graphics and gui on the other side. (and then use only (SDL-)server/system) Any informations about dependances between classes will be welcome ! Its quite obscur for me... :o\ In brief : feasible or not ? thnks in advance ! Xavier ___ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev