discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView drawing in tool


From: Fred Kiefer
Subject: Re: NSView drawing in tool
Date: Thu, 25 Jun 2009 09:52:06 +0200
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

David Chisnall wrote:
> As I said in my other email, this is not the correct question.  Tools
> are able to interact with the GUI.  There is nothing stopping a tool
> creating an NSApplication instance, NSWindows, and so on.  The problem
> you are facing is using gui functionality without a GUI available.
> 
> Note that you still need either libart or cairo to do drawing
> irrespective of whether you are outputting the result to the screen;
> something still needs to handle the rasterisation.
> 
> Did you try, as I suggested, creating a new graphics context backed by
> an image and drawing into that, rather than using an NSView?  NSView and
> NSWindow objects can be expected to manage some window server resources
> (whether the window server is X11, GDI, DirectFB, DPS or Quartz) and so
> will not be available when these resources are not available.
> 
> If you can not create a graphics context backed by a bitmap image
> representation without a display server available then it is a bug.  If
> you can not create display server resources without a display server
> available then it is expected - and desired - behaviour.  Having
> programs that try to create windows 'work' but not display anything when
> they can't find the display server would violate the principle of least
> surprise.

Hi David,

there are two problems with your suggestion. The first one is that
currently when a backend gets selected it tries to fully initialize
itself. For any of the X backends this means that we call XGServer
_initXContext, which tries to set up the X display and if we aren't able
to do so we just give up. Now most of the time this surely is the right
thing to do, when somebody starts up a GNUstep application and there
isn't any X server we better tell the user as soon as we know. As for
Andreas "tool", how could GNUstep know that it will be only using an
image to draw on and never will need any windows or events?

The second problem is that currently we don't have the full support for
drawing on a bitmap image representation. What we currently do here is
draw on a cached image, that is a resource from the window system (Even
there are some bugs). With the cairo backend it seems to be possible to
improve on this, but I don't have any idea how to do this for the other
backends. I hope to get around to implement the cairo version soon, but
I wouldn't mind if somebody beats me on that.

Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]