wrapper patch: II




Hey Mathieu,

    I am in the process of making some fairly big architectural
changes to the whole GnomeView/GnomeViewFrame mechanism in order to
better integrated Controls with the rest of Bonobo, and was looking
over your mails as part of the redesign process.

Mathieu Lacage writes:
 > 
 > I want to support non inplace components.

    We basically need a way to tell a ViewFrame whether it is framing
an in-place or out-of-place component, as this is conspicuously
missing.  I propose that we add

    void     gnome_view_frame_set_in_place (GnomeViewFrame *frame,
                                            gboolean in_place);

    gboolean gnome_view_frame_get_in_place (GnomeViewFrame *frame);

Now, that will make your other suggestions easier to implement.

 > to do so, i think we should change the API as follows:
 > gnome_view_frame_set_covered should be renamed
 > gnome_view_frame_activate

    Yes, I agree completely.  I thought I remembered some argument
somewhere that activation should be a three-state variable, not a
two-state one.  Was this your idea, and what was the rationale?  I
can't seem to find any reference to it now.

 > I think non inplace components should not have their 
 > gnome_wrapper covered and they should be painted in grey.

    Yes, you're right.

 > and it would keep covered the gnome_wrapper and paint the 
 > wrapper->window for non inplace components.

    For non-inplace components, you just want to leave the wrapper
uncovered at all times, and only do the CORBA stuff when
gnome_view_frame_activate is called (i.e. just call
GNOME::View::activate() and leave the wrapper alone).

 > To do this, we should first add the activate field in GnomeViewFrame:
 > 
 > struct _GnomeViewFrame {
 > 	GnomeObject base;
 > 
 > 	GnomeWrapper    *wrapper; 
 > 	GnomeClientSite *client_site;
 > 	GNOME_View	 view;
 > 	GnomeUIHandler  *uih;
 > 	GnomeViewFramePrivate *priv;
 > 	gint activate;
 > };
 > 
 > This should be done anyway because right now, the fact that the view is
 > activated is learnt from gnome_wrapper_is_covered which is BAD as
 > the gnome_wrapper has nothing to do with the view beeing covered or not.
 > (this is the idea of separating View from data)

    I don't use gnome_wrapper_is_covered() to see if a view is active, 
and I have never suggested that anyone else do this.  It is definitely 
a bad idea.  Furthermore, a container needs to keep track of which
view is active itself *anyways*, to get focus right.  It was a design
decision not to keep track of this for the programmer in Bonobo.
Check out the way I did this in sample-container.c

 > Well, if you ppl think this is a good idea, let me know, i will send a 
 > patch implementing this idea.

    Since I'm doing lots of changes to this code now anyways, I'll
just throw this in.  Thanks for the suggestion.  Of course, this is
going to break lots of the code which uses these APIs.

 > For now, here are the patches needed to add a clean border painting to
 > gnome_wrapper.

    This doesn't seem to have been applied yet.  It looks mainly ok,
except for some magic numbers, and a few other details.  I'm not sure
how I feel about the wrapper knowing what "in-place" means.  I'd
rather see a "draw_border" flag, so I think I'll rename this and apply 
the patch once I finish with the Control/View split.

    Thanks Mathieu!

Nat



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