nanogui: Thread: Bug in srvclip2.c


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Bug in srvclip2.c
From: ####@####.####
Date: 3 Oct 2000 00:01:37 -0000
Message-Id: <Pine.LNX.4.10.10010031051540.17255-200000@helios.devel.igelaus.com.au>

Hello,

Here is a patch that fixes a bug in srvclip2.c which caused the user
region to be offset by a windows parent and not the current drawing
window.

On another note. I have almost finished a port of Mozilla to Nano-X. But I
have run into some problems. Any help would be appreciated greatly.

1. I need to be able to get a list of font names currently available. This
is for the font preferneces in Mozilla

and 

2. I need to be able to set a timeout value for the GrGetNextEvent
function so I can implement the Mozilla timer functionallity. This will
enable me to do animated images.

When these last requirements are met, the code will be released and free
to use under the Mozilla Public License.

Thanking you in advance
Peter Hartshorn

PS: I had originally attached a jpg of Mozilla running in Nano-X, but it
was rejected.

--- srvclip2.c.broken	Tue Oct  3 08:55:36 2000
+++ srvclip2.c	Tue Oct  3 08:56:34 2000
@@ -21,6 +21,7 @@
 void
 GsSetClipWindow(GR_WINDOW *wp, MWCLIPREGION *userregion)
 {
+	GR_WINDOW	*tmpwp;		/* temporary window pointer */
 	GR_WINDOW	*pwp;		/* parent window */
 	GR_WINDOW	*sibwp;		/* sibling windows */
 	GR_COORD	minx;		/* minimum clip x coordinate */
@@ -102,6 +103,7 @@
 	 * that can obscure us are the earlier siblings of all of
 	 * our parents.
  	 */
+	tmpwp = wp;
 	pwp = wp;
 /*while (pwp != rootwp) {*/
 	while (pwp != NULL) {
@@ -132,6 +134,7 @@
 break;
 	}
 
+	wp = tmpwp;
 	/*
 	 * Intersect with user region, if set.
 	 */
Subject: Re: Bug in srvclip2.c
From: "Greg Haerr" ####@####.####
Date: 3 Oct 2000 00:16:00 -0000
Message-Id: <027401c02ccf$55a4f3e0$15320cd0@gregh>

: Here is a patch that fixes a bug in srvclip2.c which caused the user
: region to be offset by a windows parent and not the current drawing
: window.

I'll add it to 0.89pre2 which I hope to release in the next or so.


: 
: On another note. I have almost finished a port of Mozilla to Nano-X. But I
: have run into some problems. Any help would be appreciated greatly.

Wow!  Which widget set are you using?  I am _very_ interested
in seeing this.  I'd like to see a screen shot, perhaps you
can try again.



: 
: 1. I need to be able to get a list of font names currently available. This
: is for the font preferneces in Mozilla

We've been making big strides in font implementation for the
ViewML project.  Are you running FreeType or Adobe Type 1?
Which fonts are you currently running, or is everything just
running based on the basic compiled-in fonts?  

I plan on releasing with 0.89pre2 a complete set of 12 truetype
fonts for Times, Arial and Courier in regular, bold, italic and bolditalic.
These fonts are free, and are part of Microsoft's web fonts free
distributable package for browsers.  I plan on getting these fonts
hooked up into Microwindows.

: 
: and 
: 
: 2. I need to be able to set a timeout value for the GrGetNextEvent
: function so I can implement the Mozilla timer functionallity. This will
: enable me to do animated images.

This shouldn't be a big deal.  We should be able to perform
this fairly easily in the client library, by sticking the timeout
value passed to select().  Would you like a GR_TIMEOUT
event passed back when it expires?

: 
: When these last requirements are met, the code will be released and free
: to use under the Mozilla Public License.

Can't wait.  Any chance I can get a preview download for testing?

Regards,

Greg


Subject: Re: Bug in srvclip2.c
From: ####@####.####
Date: 3 Oct 2000 00:35:17 -0000
Message-Id: <Pine.LNX.4.10.10010031125520.17347-100000@helios.devel.igelaus.com.au>


On Mon, 2 Oct 2000, Greg Haerr wrote:

> : Here is a patch that fixes a bug in srvclip2.c which caused the user
> : region to be offset by a windows parent and not the current drawing
> : window.
> 
> I'll add it to 0.89pre2 which I hope to release in the next or so.
> 
> 
> : 
> : On another note. I have almost finished a port of Mozilla to Nano-X. But I
> : have run into some problems. Any help would be appreciated greatly.
> 
> Wow!  Which widget set are you using?  I am _very_ interested
> in seeing this.  I'd like to see a screen shot, perhaps you
> can try again.
> 
> 
> 
> : 
> : 1. I need to be able to get a list of font names currently available. This
> : is for the font preferneces in Mozilla
> 
> We've been making big strides in font implementation for the
> ViewML project.  Are you running FreeType or Adobe Type 1?
> Which fonts are you currently running, or is everything just
> running based on the basic compiled-in fonts?  


To keep it simple, I am currently just using the built in fonts, but as we
get closer to release I will be using the true type fonts.

> 
> I plan on releasing with 0.89pre2 a complete set of 12 truetype
> fonts for Times, Arial and Courier in regular, bold, italic and bolditalic.
> These fonts are free, and are part of Microsoft's web fonts free
> distributable package for browsers.  I plan on getting these fonts
> hooked up into Microwindows.
> 
> : 
> : and 
> : 
> : 2. I need to be able to set a timeout value for the GrGetNextEvent
> : function so I can implement the Mozilla timer functionallity. This will
> : enable me to do animated images.
> 
> This shouldn't be a big deal.  We should be able to perform
> this fairly easily in the client library, by sticking the timeout
> value passed to select().  Would you like a GR_TIMEOUT
> event passed back when it expires?

What happens is this: Mozilla sets timers for tasks, and in my main loop I
get the timeout value (a struct timeval) for the next timeout function. I
need to block until I get an event from Nano-X, or an event queue (handled
via the FDINPUT) or I timeout. The big thing is that the timeout values
can vary. A GR_TIMEOUT event would be just what I need.

> 
> : 
> : When these last requirements are met, the code will be released and free
> : to use under the Mozilla Public License.
> 
> Can't wait.  Any chance I can get a preview download for testing?
> 
As soon as all the copyright notices are in place and I get the ok from
my boss I will send you a tarball and instructions.


> Regards,
> 
> Greg
> 
> 

Thankyou for your help
Peter Hartshorn

Subject: Re: Bug in srvclip2.c
From: Alan Cox ####@####.####
Date: 3 Oct 2000 00:55:49 -0000
Message-Id: <E13gGOR-0004zg-00@the-village.bc.nu>

> fonts for Times, Arial and Courier in regular, bold, italic and bolditalic.
> These fonts are free, and are part of Microsoft's web fonts free
> distributable package for browsers.  I plan on getting these fonts
> hooked up into Microwindows.

I was under the impression these were only free if you had a windows license ?

Subject: Re: Bug in srvclip2.c
From: Alex Holden ####@####.####
Date: 3 Oct 2000 09:58:12 -0000
Message-Id: <Pine.LNX.4.04.10010031044490.5267-100000@www.linuxhacker.org>

On Tue, 3 Oct 2000 ####@####.#### wrote:
> 2. I need to be able to set a timeout value for the GrGetNextEvent
> function so I can implement the Mozilla timer functionallity. This will
> enable me to do animated images.

Instead of implementing this a server call, probably the easiest way to do
it is to use setitimer() on the client side and set a flag in the alarm
handler which causes the main loop to clear the flag and return a
timeout event instead of simply rescheduling (search for "errno != EINTR"
in nanox/srvmain.c). Alternatively you could play games with the select()
timeout and gettimeofday() to handle the timeout yourself, but I suspect
that would be more difficult.

> PS: I had originally attached a jpg of Mozilla running in Nano-X, but it
> was rejected.

If you want to distribute large files and you don't have any web space of
your own, send them to me in a private mail and I'll put them up on
www.linuxhacker.org rather than bulk mailing them to everyone on the list.

--------------- Linux- the choice of a GNU generation. --------------
: Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham :
-------------------- http://www.linuxhacker.org/ --------------------

Subject: Re: Bug in srvclip2.c
From: "Greg Haerr" ####@####.####
Date: 3 Oct 2000 15:47:08 -0000
Message-Id: <042501c02d51$7028d920$15320cd0@gregh>

: Instead of implementing this a server call, probably the easiest way to do
: it is to use setitimer() on the client side and set a flag in the alarm
: handler which causes the main loop to clear the flag and return a
: timeout event instead of simply rescheduling (search for "errno != EINTR"
: in nanox/srvmain.c). 

The easiest way to handle this will be to create a new call,
GetNextEventTimeout(), which will use the timeout value
in the client's existing select() code; quite simple.  If select()
returns with a timeout, I'll create a GR_EVENT_TYPE_TIMEOUT
and return it from GetNextEventTimeout().

Regards,

Greg
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: ####@####.####
: For additional commands, e-mail: ####@####.####
: 
: 

Subject: Re: Bug in srvclip2.c
From: Alex Holden ####@####.####
Date: 3 Oct 2000 19:00:06 -0000
Message-Id: <Pine.LNX.4.04.10010031946030.572-100000@hyperspace.linuxhacker.org>

On Tue, 3 Oct 2000, Greg Haerr wrote:
> The easiest way to handle this will be to create a new call,
> GetNextEventTimeout(), which will use the timeout value
> in the client's existing select() code; quite simple.  If select()
> returns with a timeout, I'll create a GR_EVENT_TYPE_TIMEOUT
> and return it from GetNextEventTimeout().

If I understood it right though, I think he wants to wait for a specific
requested time rather than "when the next event happens, or we time out
waiting for one". Which means that unless you want to rely on select()
modifying the timeout value (something which isn't portable to a lot of
non-Linux systems and wouldn't take account of the time spent in the
client between GrGetNextEvent() calls), you'll have to work out the
absolute time of the timeout on the first call (add the timeout to the
result of a gettimeofday() call), then do another gettimeofday() to
recalculate the timeout every time you call select().

-- 
--------------- Linux- the choice of a GNU generation. --------------
: Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham :
-------------------- http://www.linuxhacker.org/ --------------------


Subject: Re: Bug in srvclip2.c
From: "Greg Haerr" ####@####.####
Date: 3 Oct 2000 20:51:26 -0000
Message-Id: <018001c02d7c$5ddd1b20$6817dbd0@censoft.com>

: If I understood it right though, I think he wants to wait for a specific
: requested time rather than "when the next event happens, or we time out
: waiting for one". 

Yes.  Good point.  I've already implemented the first, easy
version that returns either the next event or a timeout event
after the specified msecs.  So the event handler for the
timeout event should compare the start time with the
time of day on return.  This will have to happen anyway
if the application has multiple timers running.  This is
the same way that Microwindows does it for the win32
handling, using MwGetNextTimeoutValue().

Regards,

Greg

Subject: Re: Bug in srvclip2.c
From: ####@####.####
Date: 3 Oct 2000 22:06:36 -0000
Message-Id: <Pine.LNX.4.10.10010040900210.20201-100000@helios.devel.igelaus.com.au>


> If I understood it right though, I think he wants to wait for a specific
> requested time rather than "when the next event happens, or we time out
> waiting for one". Which means that unless you want to rely on select()
> modifying the timeout value (something which isn't portable to a lot of
> non-Linux systems and wouldn't take account of the time spent in the
> client between GrGetNextEvent() calls), you'll have to work out the
> absolute time of the timeout on the first call (add the timeout to the
> result of a gettimeofday() call), then do another gettimeofday() to
> recalculate the timeout every time you call select().

No, I need to return if we get an event from the server, of from my fd, or
we timeout. And I need to be able to distinguish between them



From Peter

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.