discuss-gnustep
[Top][All Lists]
Advanced

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

Draw on Xwindow directly without NSWindow


From: Yen-Ju Chen
Subject: Draw on Xwindow directly without NSWindow
Date: Fri, 28 Apr 2006 23:41:03 -0700

I am looking a way to use GNUstep AppKit to draw on Xwindow, not NSWindow.
I guess basically it depends on how NSBezierPath and drawing of
NSAttributesString is implemented.
I did some research on backend.
But I think it would be faster to get some answers
since many people here have more knowledge about backend. :)

In [XGServerWindow windowdevice:],
there is a piece of code:

 gswindow_device_t *window;
 NSGraphicsContext *ctxt;
 ctxt = GSCurrentContext();
 GSSetDevice(ctxt, window, 0, NSHeight(window->xframe));
 DPSinitmatrix(ctxt);
 DPSinitclip(ctxt);

If I can fake a gswindow_device_t and hook up to NSGraphicsContext as above,
will it redirect all the drawing into the fake gswindow_device_t ?
There are some codes in NSWindow related to GraphicState.
Are they critical for this purpose ?

Thanx a lot.

Here is the explanation why I need to do that if you are interesting:

I am trying to find a way to draw the window decorations in Azalea.
Reparenting NSWindow into XWindow does not seem to work in an easy way.
It's partially because how Azalea works.
NSWindow is always mapped as a regular client, not just a normal XWindow.
This introduces a lot of complication.
So the other easy way around is to draw directly on Xwindow.
The shortcoming of this approach is that NSWindow and NSView cannot be used,
Therefore, most GUI in AppKit is useless.
But if NSBezierPath and string drawing are still working, it is worth to try
because I can take the advantage of whatever backend GNUstep can offer.

If you are interesting in the code,
they are in http://svn.gna.org/viewcvs/etoile/branches/AzaleaAppKit/.
The window decorationi part is in AZFrame.

Thanx.

Yen-Ju




reply via email to

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