List Info

Thread: Replace NewRgn() DisposeRgn() .. etc, in salframe.cxx ( )




Replace NewRgn() DisposeRgn() .. etc, in salframe.cxx ( )
user name
2007-02-17 04:02:17
HI,

I PROPOSE A CHANGE TO REPLACE OBSOLETE CODE IN SALFRAME :

-> NEWRGN(), DISPOSERGN() , ARE DEPRECATED .

SEE ATTACHED PATCH.

TO APPLY IT, PUT IT IN VCL/AQUA/SOURCE/WINDOW, AND DO  :

PATCH -P0 --DRY-RUN <AQUA_NEWRGN.DIFF

TO SEE IF NOTHING IS WRONG

THEN, TO APPLY IT REALLY, DO :

PATCH -P0 <AQUA_NEWRGN.DIFF


ADDITIONAL COMMENTS :


THE NEW CODE DOES USE GETWINDOWBOUNDS() WITH
KWINDOWCONTENTREGION  
PARAMETER


   RECT PORTBOUNDS;
     GETWINDOWBOUNDS (PSALFRAME->MRWINDOW, 
KWINDOWCONTENTRGN,  
&PORTBOUNDS );

	SALPAINTEVENT APAINTEVT;
	APAINTEVT.MNBOUNDX = 0;
	APAINTEVT.MNBOUNDY = 0;
	APAINTEVT.MNBOUNDWIDTH = PORTBOUNDS.RIGHT -
PORTBOUNDS.LEFT;
	APAINTEVT.MNBOUNDHEIGHT =PORTBOUNDS.BOTTOM -
PORTBOUNDS.TOP;

RECT  IS A STRUCTURE DEFINING THE SIZE AND LOCATION OF A
QUICKDRAW  
RECTANGLE, BUT IS NOT DEPRECATED

IF YOU READ THE PATCH, YOU'LL SE I HAVE SET
APAINTEVENT.MNBOUNDX AND  
APAINTEVENT.MNBOUNDY TO BE 0 INSTEAD OF PORTBOUNDS.LEFT (
AND RIGHT,  
REPSECTIVELY )

THE REASON IS GETWINDOWBOUNDS WILL DRAW FROM LOCALE
COODRINATES ( IN  
THE WINDOW ), WITH ORIGIN 0,0 + HEIGHT  AND WIDTH OF THE
WINDOW.

CONTINUE TO USE

APAINTEVT.MNBOUNDX = PORTBOUNDS.LEFT;
APAINTEVT.MNBOUNDY = PORTBOUNDS.TOP;


WILL LEAD TO FUNKY EFFECTS, SINCE PORTBOUNDS.LEFT AND
PORTBOUNDS.TOP  
ARE GLOBAL COORDINATES.

A SIMPLE TEST TO VERIFY CAN BE DONE :

1) KEEP PORTBOUNDS.LEFT , AND PORTBOUNDS.TOP

2) FOR THE DIFFERENT CASES DESCRIBED BELOW, TRY TO CREATE A
NEW  
DOCUMENT, USING THE ICON, ON LEFT -> WILL OPEN (AND ASK
TO DRAW) A  
NEW WINDOW, OUR  RECTANGLE

2.1) MAIN WINDOW IS ON LEFT (BORDERS OF THE WINDOW ON LEFT

2.2) MAIN WINDOW CENTERED

2.3) ALL SITUATIONS BETWEEN THE TWO PREVIOUS ONE


IN THE FIRST CASE, IT SHOULD WORK, IN THE SECOND, YOU'LL
OBTAIN AN  
EMPTY AREA + ALL POSSIBILITIES BETWEEN THEM 


THANKS IN ADVANCE FOR YOUR TESTS AND YOUR FEEDBACK !


ERIC BACHARD


?Ľ
Re: Replace NewRgn() DisposeRgn() .. etc, in salframe.cxx ( )
user name
2007-02-17 04:28:05
Hi,

On 17.2.2007, at 11:02, eric b wrote:

> <aqua_newrgn.diff>

after some investigation, I think the patch goes in good
way, but  
could be even more simpler.

The patch changes the event handler for
kEventWindowDrawContent. This  
event means that we have to redraw the complete window.
This window is represented by AquaSalFrame for us. But we
know what  
dimensions is this AquaSalFrame! We do not need to ask for
the  
dimensions of its WindowRef. pSalFrame->mnWidth and
mnHeight should  
already contain the width and height.

Eric, can you please check this?
-- 
Pavel Janík


------------------------------------------------------------
---------
To unsubscribe, e-mail: mac-unsubscribeporting.openoffice.org
For additional commands, e-mail: mac-helpporting.openoffice.org


Re: Replace NewRgn() DisposeRgn() .. etc, in salframe.cxx ( )
user name
2007-02-18 14:34:30
Hi Pavel,

Pavel Janík a écrit :
> Hi,

>> <aqua_newrgn.diff>
>  
> after some investigation, I think the patch goes in
good way, but  could 
> be even more simpler.

Thank you very much for the review.

> The patch changes the event handler for
kEventWindowDrawContent. This  
> event means that we have to redraw the complete
window.
> This window is represented by AquaSalFrame for us. But
we know what  
> dimensions is this AquaSalFrame! We do not need to ask
for the  
> dimensions of its WindowRef. pSalFrame->mnWidth and
mnHeight should  
> already contain the width and height.

Indeed, you're completely right !

> Eric, can you please check this?

Yes, and with the tests I just did, it works fine. a new
patch arrives 
soon, waiting for confirmation.


Regards,
Eric

------------------------------------------------------------
---------
To unsubscribe, e-mail: mac-unsubscribeporting.openoffice.org
For additional commands, e-mail: mac-helpporting.openoffice.org


Re: Replace NewRgn() DisposeRgn() .. etc, in salframe.cxx ( )
user name
2007-02-18 14:39:01
New patch is : 
http://eric.bachard.f
ree.fr/mac/aquavcl/patches/controls/fev_2007/18_02_07/aqua_n
ewrgn.diff

Thanks in advance for any feedback 

Eric




------------------------------------------------------------
---------
To unsubscribe, e-mail: mac-unsubscribeporting.openoffice.org
For additional commands, e-mail: mac-helpporting.openoffice.org


Re: Replace NewRgn() DisposeRgn() .. etc, in salframe.cxx ( )
user name
2007-03-11 17:41:02
Change has been commited in aquavcl01 cws.

Regards,
Eric Bachard

------------------------------------------------------------
---------
To unsubscribe, e-mail: mac-unsubscribeporting.openoffice.org
For additional commands, e-mail: mac-helpporting.openoffice.org


[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )