intrinsic size of object (br33903)

Koos Vriezen koos.vriezen at xs4all.nl
Wed Mar 2 14:32:15 GMT 2005


On Wed, Mar 02, 2005 at 01:43:10PM +0100, David Faure wrote:
> On Tuesday 15 February 2005 17:51, Koos Vriezen wrote:
> > On Tue, Feb 15, 2005 at 03:05:53PM +0100, David Faure wrote:
> > > On Friday 11 February 2005 14:18, Koos Vriezen wrote:
> > > > On Fri, Feb 11, 2005 at 02:07:24PM +0100, David Faure wrote:
> > > > > On Friday 11 February 2005 13:29, Koos Vriezen wrote:
> > > > > > Anyway, some time ago Stephan add me to the CC list of br33903. So I
> > > > > > guess to fix this for all kinds of kparts and w/o using the liveconnect
> > > > > > extension, a signal in BrowserExtension is needed, where to the KHTMLPart
> > > > > > is connected and doing something like the javascript does. Of course I
> > > > > > can fix that. I something like that acceptable for khtml?
> > > > > 
> > > > > I'm not following - which signal would you add to BrowserExtension?
> > > > 
> > > > Something like we have already:
> > > >   /**
> > > >    * Ask the hosting application to resize the top level widget.
> > > >    */
> > > >   void resizeTopLevelWidget( int w, int h );
> > > > 
> > > > But maybe we need two, or have a bool for that, that will tell khtml the
> > > > difference between the intrinsic size and a 'normal' resize. First case
> > > > should be ignored in case the object has width/height attributes already.
> > > > Eg.
> > > >    void reizeWidget(int w, int h, bool intrinsic);
> > > 
> > > This is about a part (e.g. java?) that is embedded into KHTMLPart, right?
> 
> Thinking about this - the signal sounds good. However it's up to the host to decide
> whether to honour the resize request or not, so I would rename it to
> 
>   void setIntrinsicSize( int w, int h );
> or even, for a more Qt-like name,
>   void setContentsSize( int w, int h );
> 
> In the '<object type="image/png" WIDTH=50 HEIGHT=100></object>' case,
> the host will just ignore that signal, otherwise it can use the information to resize
> the object. Is that what's needed?

Yes, but also a 'normal' resize (eg. see
http://java.sun.com/j2se/1.5.0/docs/api/java/applet/Applet.html#resize(java.awt.Dimension)
 for option three below)

So there are three cases:
1. initial size given as '<object type="xx/yy" WIDTH=50 HEIGHT=100 ..>'
2. initial size not given, so object determines it after loading
3. a resize during normal operation.

However, we can choose to ignore 3. It does work with the
javaappletviewer ATM because of sending the 'this.setAttribute("WIDTH...'
script to the hosting part.
Obviously 3 makes only sense to parts w/ dynamic contents like
java/video.... hmm testing it w/ firefox and IE, I see that both of them
don't support option 3.
Ok I agree with you then, we only need a signal for case 2.

Koos




More information about the kfm-devel mailing list