Re: Clipboard details



Since you have the inertia and are coding already, this can go straight
to the bit bucket, but since you asked for comment, here's an
alternative approach in case you didn't consider it...

module Bonobo {
    module Clipboard {
        interface Registry {
            void addContainer (in UIContainer uic,
                          in Selection sel);
            void removeContainer (in UIContainer uic);
        };

The clipboard merges UI elements, and therefore we don't have a pile of
duplicated code in every application just to implement the standard menu
items. In the event driven container responsible model, there are some
traps like how does the container know when to release a copied/cut
item.  It can't do it on a change event, because it will get one of
those even when it initially sets the clipboard.  This kind of guarding
code can be avoided by just putting UI in the clipboard's domain.

        interface Selection {
            void cutSelection ();
            void copySelection ();
            void dispose();
            Stream getContents();
        };

I think this approach makes the container implementation simpler and
puts the clipboard more in control of the functionality, instead of
having the clients duplicate a lot of control logic.

Mike






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