discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSGraphicsContext without NSWindow ?


From: Banlu Kemiyatorn
Subject: Re: NSGraphicsContext without NSWindow ?
Date: Thu, 23 Oct 2003 22:27:42 +0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030708

Yen-Ju Chen wrote:
Hi,

 Is it possible to use NSGraphicsContext without NSWindow ?

AFAIK, Yes and No. a window device is tied with the NSWindow at the
back-x11. You may have to construct a gswindow_device_t (not sure about
the name I'm about to run home) and the drawing backends
(art,x11,cairo(ahem)) can actually draw onto the device.
So, if you are lucky and can use gswindow_device_t(?) directly,
then you should be able to draw onto it but it looks very much
like a hack to me and you may end up keep shuffling the graphic
states to make the state compatible with the system. A more work, I
guess.

All these, I could be wrong. So I'd say, try it if you wish.

One benefit of using NSWindow directly is, the window of StepBox
itself, doesn't need to be reparented into this newly created
gswindow device. And it is a much cleaner approach to me.

I try to use DPS operation for drawing in window manager instead Xwindow drawing function.

It take 0 as root window, I'd guess.


 It works on root window of screen since I fake an internal window device,
 but fail for others.
 I can't use NSWindow becuase the circularity problem.


That's why I think it is neccessary to subclass XGServer and
set this new class to the display server. Override GSBackend
initializeBackend with category should work. (copy the source
and change x11,win32 to the new class) or may be adding
user specified display server to that code directly.

This mean, do not reparent your own window when it is mapped.
may be put an atom on it when you create the window.

 Any hint to use NSGraphicsContext (or its subclass) without NSWindow ?

No idea.






reply via email to

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