discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Draw on Xwindow directly without NSWindow


From: Yen-Ju Chen
Subject: Re: Draw on Xwindow directly without NSWindow
Date: Sat, 29 Apr 2006 16:45:20 -0700

On 4/29/06, Fred Kiefer <fredkiefer@gmx.de> wrote:
[snip]

I have been giving this some thought. Wouldn't it resolve your problem,
if we add to GNUstep an implementation of the method [NSWindow
initWithWindowRef:], where the window ref would be the X window?
This should give about the same results as your code, but in a well
defined way. The code inside of initWithWindowRef: would be a mixture of
the code from _initBackendWindow and
initWithContentRect:styleMask:backing:defer:screen:, where the size,
style, level, screen and backingstore information would be extracted
from the underlying X window by a new backend method, that would also
return a GNUstep window number.
For your special environment we need to ensure that the window
decoration handling is set correctly. Somehow we need to trick the x
backend as well as the gui code into thinking that the window
decoratione should not be handled at their level :-)

I am willing to write this code, if you can provide a test application
for it, that is point me to the part of teh Azalea code that would use this.

Thanx a lot.
This method may be useful for only a few applications.
So it may not worth to put inside GNUstep as a core function.
As long as it works, I don't care whether it is in GNUstep or Azalea.

I attach a little test application.
It starts as a GNUstep application and create a XWindow.
So the task is to use GNUstep drawing functions to draw
on the drawableXWindow in AZTest.
I paint it white and the parent (mainXWindow) black.
You can remove the painting if you want.
As long as it can draw NSBezierPath, NSString and NSImage,
it will probably work for me.
Don't worry about the resize and conversion of geometry between AppKit
and XWindow.
They are minor issues.
I left some extra codes related to XWindow inside just in case you need.

If you want to test in Azalea,
look at etoile/branches/AzaleaAppKit/AZFrame.m and AZFrame+Render.m.
Two variables, title and handle, will be used to draw the decoration.
Look at the usage of createWindow() to find these two variables.

Thanx again.

Yen-Ju


Cheers
Fred

Attachment: AZTest.tar.gz
Description: GNU Zip compressed data


reply via email to

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